File tree 4 files changed +8
-4
lines changed
4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ cargo clippy
91
91
92
92
#### Automatically applying Clippy suggestions
93
93
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.
95
96
96
97
``` terminal
97
98
cargo clippy --fix
Original file line number Diff line number Diff line change @@ -111,7 +111,8 @@ fn main() {
111
111
112
112
### Automatically applying Clippy suggestions
113
113
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.
115
116
116
117
``` terminal
117
118
cargo clippy --fix
Original file line number Diff line number Diff line change @@ -79,9 +79,11 @@ is explicitly specified in the options.
79
79
80
80
### Fix mode
81
81
You 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).
83
83
This lets us spot bad suggestions or false positives automatically in some cases.
84
84
85
+ > Note: Fix mode implies ` --all-targets ` , so it can fix as much code as it can.
86
+
85
87
Please note that the target dir should be cleaned afterwards since clippy will modify
86
88
the downloaded sources which can lead to unexpected results when running lintcheck again afterwards.
87
89
Original file line number Diff line number Diff line change 13
13
14
14
Common options:
15
15
--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`
17
17
-h, --help Print this message
18
18
-V, --version Print version info and exit
19
19
--explain LINT Print the documentation for a given lint
You can’t perform that action at this time.
0 commit comments