-
Notifications
You must be signed in to change notification settings - Fork 681
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 format test to CI #1748
Add format test to CI #1748
Conversation
6498cee
to
8a17256
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.
Call me old-fashioned, but I still prefer 80-characters lines. Could you please add a rustfmt.toml file that contains:
max_width = 80
.cirrus.yml
Outdated
@@ -18,6 +18,8 @@ build: &BUILD | |||
- . $HOME/.cargo/env || true | |||
- $TOOL +$TOOLCHAIN -Vv | |||
- rustc +$TOOLCHAIN -Vv | |||
- if [ -z "$TOOLCHAIN" ]; then rustup component add rustfmt; else rustup +$TOOLCHAIN component add rustfmt; fi | |||
- $TOOL +$TOOLCHAIN fmt --all -- --check |
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.
cargo fmt
ignores cfg directives, so running it once suffices to provide coverage for every OS. Running it on every OS is duplicative. Instead, you should either create a new task just for this, or else put it into the "Rust Stable" task.
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 created a new CI task. This way, if this is the only test failing, the person who submitted the PR will easily know that the PR failed due to bad formatting. I have tested the commit without applying the formatting changes and everything seems fine
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 also added the rustfmt.toml
file specifying that the max width needs to be 80 characters.
ffaf9f9
to
f3da089
Compare
To enforce uniformity for all PRs, the CI checks if the code is formatted rigth using `cargo fmt` tool. Signed-off-by: Costin-Robert Sin <[email protected]>
Signed-off-by: Costin-Robert Sin <[email protected]>
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.
bors r+
1854: Reformat everything r=rtzoeller a=SUPERCILEX Unfortunately, #1748 didn't do the trick because of rust-lang/rustfmt#3253. This PR fully enforces global formatting. Closes #770 Co-authored-by: Alex Saveau <[email protected]>
To enforce uniformity for all PRs, the CI checks if the code
is formatted right using
cargo fmt
tool.Results after implementing the format test in CicleCI, but before fixing the format errors: https://cirrus-ci.com/build/4684991404703744
Results after fixing the format errors: https://cirrus-ci.com/build/5423803479097344
Solves #770