Skip to content

Conversation

@jcjones
Copy link
Contributor

@jcjones jcjones commented Jan 21, 2026

This is an update to #4262 and mostly implements #3056. In three commits it:

  1. Replaces the use of ripgrep with rustfmt nightly for comment length enforcment
  2. Adds the imports_granularity setting at Crate and applies it.
  3. Adds the group_imports setting at StdExternalCrate and applies it.

I did not include #3056's suggestion for format_strings though I've confirmed it compiles and tests fine. I did not because unlike the above changes, it sharply diverges from non-nightly rustfmt and if you format one to the other, everything gets clobbered repeatedly.

I think we should take format_strings as a follow-on. Besides, it touches a lot of places and would crazily clutter this PR.

@jcjones jcjones marked this pull request as ready for review January 21, 2026 20:47
@jcjones jcjones requested a review from a team as a code owner January 21, 2026 20:47
- name: Install ripgrep
run: sudo apt-get update && sudo apt-get install -y ripgrep
- name: Install nightly rustfmt
run: rustup toolchain install nightly --component rustfmt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous "Install Rust toolchain" step already installs rustfmt, so I think this should be resolved against it. Does anything bad happen if we rustup install on top of what dtolnay/rust-toolchain does? Can dtolnay/rust-toolchain install a nightly rustfmt but stable clippy and rustc for us in one step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, I'll look into that!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rust-toolchain action does call rustup default ..., so maybe we should just run it twice, with the stable one second, and a different set of components for each.

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.

4 participants