-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
style: formatting #184
style: formatting #184
Conversation
64b5975
to
3e95817
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #184 +/- ##
=====================================
Coverage 6.40% 6.40%
=====================================
Files 27 27
Lines 1997 1997
Branches 1997 1997
=====================================
Hits 128 128
Misses 1869 1869
|
All looks perfect to me! Again, this gives me so much piece of mind! Thank you very much ❤️ |
c09abbb
to
70b4ca5
Compare
70b4ca5
to
a162a18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very excited! Thanks for the effort you put into this. I think it will have a very positive impact on our development output as a team!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have open a PR to extend the githooks with TOML and features formating in #229.
Happy to rebase that PR if we want to merge this first! 👍
As this has been sitting for a week, my suggestion would be to get this merged and then treat that as a separate PR. I have not tested that locally so not sure how much additional time it adds running the checks prior to a push? |
Co-authored-by: Tin Chung <[email protected]>
Co-authored-by: Tin Chung <[email protected]>
Improves formatting and checks through standardisation. The main goal is automation as much as possible, whether possible in the dev environment or automated via CI.
CI
This draft adds the following checks only (i.e. no auto-fixes).
.rustfmt.toml
)cargo +nightly fmt --all
or configured in editor/ide or commit hookstaplo format --check
andtaplo format
to fixzepter format features
andzepter format features --fix
to fixManifest formatting is generally alphabetically by 'region', inline with Rust imports which are alphabetical and grouped by source (std library, external, internal). I feel the latter does indeed have some benefit over one large grouping. Subjective grouping of imports can make it difficult for others to immediately understand how things should be grouped and applying accordingly. Using a standard approach eliminates this concern.
Local
A pre-push git hook is included at
./githooks
and needs to be manually installed via the instructions in the readme at the same location. It currently only runs the Rust formatting checks as listed above, but can be extended to include the other checks noted as well.A pre-commit hook could also be added to auto-format, but most editors/ides probably allow this to be set on save so re-running it all again on each commit might be overkill.