Skip to content
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

Auto-format code with "cargo fmt" and check in CI #615

Merged
merged 2 commits into from
Jul 25, 2023

Conversation

micolous
Copy link
Contributor

This auto-formats the entire repository with cargo fmt (rustfmt) and checks it in CI, in line with the Rust Style Guide's recommendation (previously known as RFC 2436):

Formatting code is a mostly mechanical task which takes both time and mental effort. By using an automatic formatting tool, a programmer is relieved of this task and can concentrate on more important things.

This is using the formatter's default settings, as it's not clear what the existing style standards apply to this project, and that's at least fairly consistent with the rest of the Rust ecosystem.

These PRs are where it looks like a code formatter was run (not necessarily full rustfmt, but even trivial things like stripping trailing whitespace), leading to larger diffs in unrelated code:

By using an auto-formatter, it means that it's much easier to write PRs that merge cleanly without noise, while also laying everything out consistently.

This PR is split into two commits:

Because the fix-ups are a huge diff that'll be difficult to review (and would break if there are any other changes merged prior), you might want to cherry-pick the first commit and run cargo fmt yourself, or otherwise swap it around.

@jrmuizel jrmuizel enabled auto-merge July 11, 2023 13:35
@bors-servo
Copy link
Contributor

☔ The latest upstream changes (presumably 127f2be) made this pull request unmergeable. Please resolve the merge conflicts.

auto-merge was automatically disabled July 25, 2023 01:45

Head branch was pushed to by a user without write access

@micolous
Copy link
Contributor Author

Rebased at 127f2be, the CI change is now 163fa33, and I regenerated the auto-formatter commit as 7cc1579.

@micolous
Copy link
Contributor Author

It looks like a bot needs a poke to push this forward, and I don't have write access to push things, even if they have the auto-merge bit set.

@jrmuizel jrmuizel added this pull request to the merge queue Jul 25, 2023
Merged via the queue into servo:master with commit b009c87 Jul 25, 2023
@waywardmonkeys waywardmonkeys mentioned this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants