-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
switch to non-recursive mode by default #3938
Merged
topecongiro
merged 4 commits into
rust-lang:master
from
calebcartwright:non-recursive-default
Dec 9, 2019
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fe5f668
refactor: switch to non-recursive mode for default
calebcartwright 3c76a63
refactor: pass opts ref to build_rustfmt_args
calebcartwright 01828f0
refactor: update description for recursive mode
calebcartwright bfd1114
refactor: make recursive config optional internal only
calebcartwright File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider
recursive
as one of the internal options. We do not want users to add this to the configuration by themselves.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do 👍, though out of curiosity, why should this be a CLI only flag for users?
One downside I see with exposing
recursive
as a config option is thatrecursive = false
in the config file would functionally be ignored when usingcargo fmt
since cargo fmt will always pass--recursive
flag to rustfmt which will always take precedence over the config file value (which could be confusing for users).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The options in the configuration file are meant to be persistent, whereas
recursive
is more of a one-shot configuration, which best suits as a CLI flag.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me! It wouldn't surprise me if there is a future request to support
recursive
as a config option sinceskip_children
was available, but there's clearly several good reasons whyrecursive
should be internal/cli-only.Side note, while making recursive internal I noticed that internal options added to the config file seem to just be silently ignored. Do I have that correct?
If they are silently ignored:
Is that the desired behavior or would it beneficial to emit a warning (
"Warning: Unknown configuration option ..
)? Would that potential change be tackled (perhaps it already is) as part of #3873 or should I open a new issue?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
We should make it to a hard error rather than silently ignoring it.
This should be fixed by #3873.