rust-lang / rust-lang/rustfmt

`imports_granularity` not working on global config file

Open
#5,471 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P-medium S-duplicate
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

this is very weird, if my config file is at /Users/lara/Library/Preferences/rustfmt/rustfmt.toml the options are detected (cargo fmt complains it can't set the options on stable), but they don't do anything.. i'm not sure if only imports_granularity is affected

putting the file at /Users/lara/rustfmt.toml or next to Cargo.toml makes it work fine

rustfmt version is rustfmt 1.5.1-nightly (4d6d601c 2022-07-26)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with rustfmt 1.5.1-nightly using a config at /Users/lara/Library/Preferences/rustfmt/rustfmt.toml, then compare it with /Users/lara/rustfmt.toml and a file beside Cargo.toml. Start from cargo fmt and the imports_granularity option; done means the global configuration affects formatting consistently or the limitation is documented and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.