1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-20 14:31:15 +02:00

Enable imports_granularity for rustfmt (#637)

This requires us to run a nightly Rust for our formatting check[1]. Other
users will see a warning when invoking `rustfmt`:

  Warning: can't set `imports_granularity = Module`, unstable features
  are only available in nightly channel.

This should be harmless overall and help us ensure better consistency
in our import formatting.

[1]: https://rust-lang.github.io/rustfmt/?version=v1.5.1&search=#imports_granularity
This commit is contained in:
Martin Geisler 2023-05-16 12:35:49 +02:00 committed by GitHub
parent a788680d5e
commit b4fb870af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -16,7 +16,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Format Rust code
- name: Install nightly rustfmt
run: |
rustup default nightly
rustup component add rustfmt
- name: Check Rust formatting
run: cargo fmt --all -- --check
cargo:

View File

@ -1,2 +1,2 @@
# imports_granularity = "module"
imports_granularity = "module" # Please use nightly for this setting.
max_width = 90