File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ cargo clippy
9191
9292#### Automatically applying Clippy suggestions
9393
94- Clippy can automatically apply some lint suggestions, just like the compiler.
94+ Clippy can automatically apply some lint suggestions, just like the compiler. Note that ` --fix ` implies
95+ ` --all-targets ` , so it can fix as much code as it can.
9596
9697``` terminal
9798cargo clippy --fix
Original file line number Diff line number Diff line change @@ -111,7 +111,8 @@ fn main() {
111111
112112### Automatically applying Clippy suggestions
113113
114- Clippy can automatically apply some lint suggestions, just like the compiler.
114+ Clippy can automatically apply some lint suggestions, just like the compiler. Note that ` --fix ` implies
115+ ` --all-targets ` , so it can fix as much code as it can.
115116
116117``` terminal
117118cargo clippy --fix
Original file line number Diff line number Diff line change @@ -79,9 +79,11 @@ is explicitly specified in the options.
7979
8080### Fix mode
8181You can run ` cargo lintcheck --fix ` which will run Clippy with ` --fix ` and
82- print a warning if Clippy's suggestions fail to apply (if the resulting code does not build).
82+ print a warning if Clippy's suggestions fail to apply (if the resulting code does not build).
8383This lets us spot bad suggestions or false positives automatically in some cases.
8484
85+ > Note: Fix mode implies ` --all-targets ` , so it can fix as much code as it can.
86+
8587Please note that the target dir should be cleaned afterwards since clippy will modify
8688the downloaded sources which can lead to unexpected results when running lintcheck again afterwards.
8789
Original file line number Diff line number Diff line change 1313
1414Common options:
1515 --no-deps Run Clippy only on the given crate, without linting the dependencies
16- --fix Automatically apply lint suggestions. This flag implies `--no-deps`
16+ --fix Automatically apply lint suggestions. This flag implies `--no-deps` and `--all-targets`
1717 -h, --help Print this message
1818 -V, --version Print version info and exit
1919 --explain LINT Print the documentation for a given lint
You can’t perform that action at this time.
0 commit comments