rust-lang / rust-lang/rustfmt

Ignore option still reads rustfmt.toml from excluded folders

Open
#4,726 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

only-with-option P-low
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

Describe the bug
Ignore option still reads rustfmt.toml from excluded folders

To Reproduce

tree         
├── Cargo.lock
├── Cargo.toml
├── patched
│   └── webpki
│       ├── Cargo.toml
│       ├── rustfmt.toml  < 'merge_imports=true'
│       └── src
│           └── webpki.rs
└── rustfmt.toml  < 'ignore = ["patched",]'


cargo fmt                                  
Warning: the `merge_imports` option is deprecated. Use `imports_granularity=Crate` instead

example.zip

Expected behavior
no output

Meta

  • rustfmt version: rustfmt 1.4.36-nightly (7de6968 2021-02-07)
  • From where did you install rustfmt?: rustup component add rustfmt
  • How do you run rustfmt: cargo fmt

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

Unpack example.zip and run cargo fmt in the example tree, then compare the root rustfmt.toml with the excluded patched/webpki/rustfmt.toml. Trace how rustfmt discovers configuration in excluded folders; done means cargo fmt produces no warning about the excluded folder's deprecated merge_imports option.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.