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
Enforce rustfmt on CI #22126
Enforce rustfmt on CI #22126
Conversation
Heads up! This PR modifies the following files:
|
Yes this is a replacement for #20617. Rustfmt is now installed with rustup and not with cargo anymore. |
If we do this, which makes more annoying for me to port Gecko changes, can we enable the reordering of imports and such, and remove the tidy one? At least that'd be roughly neutral or even positive on the effort it takes me :) Also, maybe, remove the |
python/servo/testing_commands.py
Outdated
@@ -304,6 +304,12 @@ def test_content(self): | |||
"tests/wpt/mozilla/.") | |||
return 0 | |||
|
|||
def install_rustfmt(self): | |||
if self.call_rustup_run(["cargo", "fmt", "--version", "-q"], | |||
stderr=open(os.devnull, "w")) != 0: |
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.
Doesn't this leak the file descriptor?
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.
Good catch!
Let's have two more commits - one that disables the tidy check for import ordering, and one that enables rustfmt import reordering and formats the whole tree with it. |
@bors-servo r+ |
📌 Commit 5de5fab has been approved by |
@bors-servo r- |
Also apparently travis is not set up to run cargo fmt yet:
|
And the selftests failed:
|
I've pushed the two commits as suggested by @jdm. There are still a few problems with this PR:
|
☔ The latest upstream changes (presumably #22086) made this pull request unmergeable. Please resolve the merge conflicts. |
Add ./mach fmt command. Mach installs rustfmt if needed.
Rebased and fixed. Lets see if it works in Travis. |
|
Install rustup on first Travis job. Only use rustfmt::skip as an outer attribute.
Travis now passes. AppVeyor has some connectivity issues:
|
@bors-servo r+ |
📌 Commit 1855c88 has been approved by |
Enforce rustfmt on CI <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22126) <!-- Reviewable:end -->
☀️ Test successful - android, android-mac, android-x86, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, status-taskcluster, windows-msvc-dev |
Nice! @pyfisch, are you subscribed to the dev-servo mailing list? I think it’d be nice to send an announcement there with:
If you prefer I can do it for you :) |
Sent an email. |
This change is