You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ms2ger and I have filed a lot of issues each time we've tried rustfmt on Servo. We could certainly start running it on particular files that don't end up with terrible output.
Anyone know how Go projects incorporate gofmt (or Rust w/ rustfmt) into project workflows? Require that it get used pre-commit and checked via CI? Have the build system automatically format upon check-in (which sounds scary)? Something else?
Checked via CI I think. Similar to how clippy checks update_lints or how servo checks lockfile_changed.
I'd rather not gate CI on rustfmt though. I'm slightly more okay with it if we use circleci or something for tidy+fmt to get separate and immediate status icons from the long build.
normalize_comments prevents the license comment from being reformatted to use line comments instead of block comments. We might want to do that anyway, but it's nice to reduce the impact of the first run.
rustfmt currently doesn't reorder extern crates. Furthermore, it reformats #[attr] extern crate foo; into two lines, which breaks tidy (tidy only asks for the sorting of extern crate lines which do not have attributes, since the ones with attributes usually have special requirements for ordering). We'll need to change this a bit and/or add extern crate sorting to rustfmt.
I would like to reformat everything and slowly make rustfmt part of CI checks. Perhaps removing the corresponding tidy checks.
Activity
tetsuharuohzeki commentedon Nov 16, 2015
cc: @Manishearth ?
jdm commentedon Nov 16, 2015
Ms2ger and I have filed a lot of issues each time we've tried rustfmt on Servo. We could certainly start running it on particular files that don't end up with terrible output.
Manishearth commentedon Nov 16, 2015
It's not ready yet. I periodically try running it on Servo.
frewsxcv commentedon Nov 18, 2015
Anyone know how Go projects incorporate gofmt (or Rust w/ rustfmt) into project workflows? Require that it get used pre-commit and checked via CI? Have the build system automatically format upon check-in (which sounds scary)? Something else?
tetsuharuohzeki commentedon Nov 18, 2015
I think it would be better to check in CI the commited files as tidy which we're running. It's not enough?
Manishearth commentedon Nov 18, 2015
Checked via CI I think. Similar to how clippy checks update_lints or how servo checks lockfile_changed.
I'd rather not gate CI on rustfmt though. I'm slightly more okay with it if we use circleci or something for tidy+fmt to get separate and immediate status icons from the long build.
Manishearth commentedon Jan 2, 2017
So I've been poking around, and rustfmt seems to be much more stable now.
The following toml config is pretty nice for servo
normalize_commentsprevents the license comment from being reformatted to use line comments instead of block comments. We might want to do that anyway, but it's nice to reduce the impact of the first run.rustfmt currently doesn't reorder
extern crates. Furthermore, it reformats#[attr] extern crate foo;into two lines, which breaks tidy (tidy only asks for the sorting of extern crate lines which do not have attributes, since the ones with attributes usually have special requirements for ordering). We'll need to change this a bit and/or add extern crate sorting to rustfmt.I would like to reformat everything and slowly make rustfmt part of CI checks. Perhaps removing the corresponding tidy checks.
Thoughts? @jdm @Ms2ger @Wafflespeanut
jdm commentedon Jan 2, 2017
I'm open to that plan. I think adding extern crate reordering to rustfmt makes the most sense.
Auto merge of #14831 - servo:rustfmt-traits, r=nox
Auto merge of #19681 - pyfisch:rustfmt-display-lists, r=emilio
pyfisch commentedon Jan 20, 2018
🎉 rustfmt now works well on servo with this config:
It can be installed with
rustup install rustfmt-previewfor servo and run withcargo fmt --package layoutfor individual packages likelayout.The formatting works with
./mach test-tidybut the long (>100 character) imports need to be formatted by hand.atouchet commentedon Nov 7, 2018
Is this done now?
CYBAI commentedon Nov 7, 2018
Done by #22126 !