-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Collapse if
and if let
chains in Clippy itself
#14228
base: master
Are you sure you want to change the base?
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 |
b78eba0
to
ea66a22
Compare
By default, lintcheck will use the `clippy.toml` file found at the toplevel of the repository (`CARGO_MANIFEST_DIR`). This file is meant for configuration of Clippy applied to Clippy sources. This creates a new `lintcheck/ci-config/clippy.toml` file which is used by the CI when running lintcheck. By default this uses the default Clippy configuration.
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): |
Due to its use of `Sugg::ast()` to combine `if` conditions together, `collapsible_if` cannot keep comments located inside the conditions or between the conditions in its suggestions. However, it is still possible to warn about those situations and let the user fix their code by themselves. A new configuration option `lint_commented_code`, which is `true` by default, opts out from this behavior.
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.
Those are warned about but not autofixed as the comments inside the `if` conditions would be lost.
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
|
This adds a
collapse_let_chains
config option to thecollapsible_if
lint. 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 two commits of this PR are best looked at side by side, with whitespace differences turned off.
changelog: none