-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Collapse if and if let chains in Clippy itself
#14228
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
Conversation
04763f2 to
b017927
Compare
4eab1e1 to
b68a741
Compare
99ccf9c to
b78eba0
Compare
|
Way too many hits from lintcheck, will double check. Edit: lintcheck from the CI seems to use |
ea66a22 to
fd78e73
Compare
|
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands: The following commits are merge commits: |
Those will disappear after the PR it depends on are merged – I'll push with a linear history then, which will contain the same content. |
fd78e73 to
ec376b4
Compare
|
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands: The following commits are merge commits (since this message was last posted): |
ec376b4 to
fe92927
Compare
|
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands: The following commits are merge commits (since this message was last posted): |
fe92927 to
b034880
Compare
|
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands: The following commits are merge commits (since this message was last posted): |
b034880 to
7407b15
Compare
|
There are merge commits (commits with multiple parents) in your changes. We have a no merge policy so these commits will need to be removed for this pull request to be merged. You can start a rebase with the following commands: The following commits are merge commits (since this message was last posted): |
|
I'll put this on hold until let chains are stabilized. |
|
Failed to set assignee to
|
4b2e944 to
36e0eed
Compare
|
Rebased |
c899570 to
d3ad015
Compare
d3ad015 to
0eea540
Compare
|
Rebased |
|
Just based off a quick look I'm completely ok with merging this before stabilization, we've already had lints like |
77cf95b to
b5a2e15
Compare
b5a2e15 to
9401b6c
Compare
This needs to be done in steps, as it uses non-default values for options when linting Clippy itself. This requires turning the option back to its default value for lintcheck, which in turn requires the option to be known for lintcheck @flip1995 already merged #14231, now #14451 is ready, then I'll assign #14455 to you (first part of this PR), then this one will be ready for review (containing only the latest commit). |
9401b6c to
247c8b8
Compare
52be538 to
2a5f065
Compare
This PR enables the new ability to collapse `if` statements containing comments (without losing them) in Clippy sources, excluding tests and lintcheck, where the default behaviour (no collapsing in presence of comments) is preserved. To be applied after #14231. When it is applied, #14455 will be marked as ready for review, then #14228 afterwards. changelog: none r? ghost
Since `collapsible_if` is an early lint, it is not possible to automatically check whether the `let_chains` unstable rustc feature is enabled or not, as features are not available in the `EarlyContext` object. For this reason, the `collapse-let-chains` needs to be enabled explicitly. This can be reexamined later when the `let_chains` feature is stabilized.
tests and lintcheck runs are not affected, and will use the default non-collapsing setting.
2a5f065 to
e23e458
Compare
This adds a
collapse_let_chainsconfig option to thecollapsible_iflint. This lint is then applies to Clippy itself. This reduces the level of indentation in Clippy source code in many locations.The first two commits are from PR #14231, the third one from PR #14233. They must be merged first (or as part of this PR).
If reviewed on GitHub, the last three commits of this PR are best looked at side by side, with whitespace differences turned off.
changelog: none