-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add automatic formatting via pre-commit hooks #179
Conversation
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.
Just one minor thing
newline_style = "Unix" | ||
comment_width = 100 | ||
format_code_in_doc_comments = true | ||
imports_granularity = "Crate" |
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.
Can we also set group_imports = StdExternalCrate
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.
Yes.
What version of |
I believe the rust-toolchain.toml file will clamp it to a specific nightly, like the bootstrap for xtask does. I don't think it's a huge deal. |
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.
LGTM
This PR is the first in a set that will add automatic formatting via pre-commit hooks and CI. Formatting is done by rustfmt, and is controlled by .rustfmt.toml.
I plan to apply the formatting changes that rustfmt wants in a separate PR, so as to limit all formatting changes to a single PR. Once the code is reformatted according to the rustfmt config we decide on, I'll update documentation to describe how to setup the pre-commit hook when contributing.
Starting this PR now so any bikeshedding discussion for rustfmt can be contained.