fix(config): search for config file recursively on --config-path - #7115
Open
rami3l wants to merge 4 commits into
Open
fix(config): search for config file recursively on --config-path#7115rami3l wants to merge 4 commits into
--config-path#7115rami3l wants to merge 4 commits into
Conversation
rami3l
marked this pull request as ready for review
September 11, 2026 20:46
rami3l
force-pushed
the
fix/config-path-dirwalk
branch
from
September 11, 2026 20:52
ba0a09c to
6bc2a74
Compare
rami3l
marked this pull request as draft
September 12, 2026 07:14
Member
Author
|
I still some concerns regarding the distinction between the dir mode and the TOML mode, so reconverting to draft. |
rami3l
force-pushed
the
fix/config-path-dirwalk
branch
from
September 12, 2026 08:23
6bc2a74 to
3f3d54b
Compare
rami3l
marked this pull request as ready for review
September 12, 2026 08:49
Member
Author
|
Addressed the concern regarding mode switching; updated both the PR description accordingly to reflect the new design. This PR is ready for review 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
LLM has been used to analyze the existing usage of directory walking behavior.
The implementation of this patch is otherwise fully manual.
Closes #4660 based on the design discussed in #4660 (comment).
Background
The
--config-pathhelp description says:However this description is not quite appropriate because:
rustfmt.To be more precise, the current semantics of
--config-pathis that when it receives apath, it chooses to enter one of the following modes in the below fallback order:pathis exists and metadata says it's a dir, then search for predefined names ([".rustfmt.toml", "rustfmt.toml"]) underpathonly. Bails out if none is found.pathexists and the metadata says it's not a dir, then interpret it as a TOML file. Bails out if none is found.Proposed solution
This PR changes it to:
pathterminates with/, or if it exists and metadata says it's a dir, then search for predefined names ([".rustfmt.toml", "rustfmt.toml"]) underpathand all its parents. Bails out if none is found.