@@ -24,7 +24,7 @@ that contains the code we want to check.
24
24
25
25
The output of Clippy is compared against a ` .stderr ` file. Note that you don't
26
26
have to create this file yourself. We'll get to generating the ` .stderr ` files
27
- with the command [ ` cargo dev bless ` ] ( #cargo-dev -bless ) (seen later on).
27
+ with the command [ ` cargo bless ` ] ( #cargo-bless ) (seen later on).
28
28
29
29
### Write Test Cases
30
30
@@ -41,20 +41,20 @@ Update the file with some examples to get started:
41
41
struct A ;
42
42
impl A {
43
43
pub fn fo (& self ) {}
44
- pub fn foo (& self ) {}
44
+ pub fn foo (& self ) {} // ~ ERROR: function called "foo"
45
45
pub fn food (& self ) {}
46
46
}
47
47
48
48
// Default trait methods
49
49
trait B {
50
50
fn fo (& self ) {}
51
- fn foo (& self ) {}
51
+ fn foo (& self ) {} // ~ ERROR: function called "foo"
52
52
fn food (& self ) {}
53
53
}
54
54
55
55
// Plain functions
56
56
fn fo () {}
57
- fn foo () {}
57
+ fn foo () {} // ~ ERROR: function called "foo"
58
58
fn food () {}
59
59
60
60
fn main () {
@@ -126,27 +126,22 @@ Note the *failures* label at the top of the fragment, we'll get rid of it
126
126
> _ Note:_ You can run multiple test files by specifying a comma separated list:
127
127
> ` TESTNAME=foo_functions,bar_methods,baz_structs ` .
128
128
129
- ### ` cargo dev bless `
129
+ ### ` cargo bless `
130
130
131
131
Once we are satisfied with the output, we need to run this command to
132
132
generate or update the ` .stderr ` file for our lint:
133
133
134
134
``` sh
135
- $ TESTNAME=foo_functions cargo uitest
136
- # (Output is as we want it to be)
137
- $ cargo dev bless
135
+ $ TESTNAME=foo_functions cargo uibless
138
136
```
139
137
140
- This write the emitted lint suggestions and fixes to the ` .stderr ` file,
141
- with the reason for the lint, suggested fixes, and line numbers, etc.
142
-
143
- > _ Note:_ we need to run ` TESTNAME=foo_functions cargo uitest ` every time before
144
- > we run ` cargo dev bless ` .
138
+ This writes the emitted lint suggestions and fixes to the ` .stderr ` file, with
139
+ the reason for the lint, suggested fixes, and line numbers, etc.
145
140
146
141
Running ` TESTNAME=foo_functions cargo uitest ` should pass then. When we commit
147
142
our lint, we need to commit the generated ` .stderr ` files, too.
148
143
149
- In general, you should only commit files changed by ` cargo dev bless ` for the
144
+ In general, you should only commit files changed by ` cargo bless ` for the
150
145
specific lint you are creating/editing.
151
146
152
147
> _ Note:_ If the generated ` .stderr ` , and ` .fixed ` files are empty,
@@ -165,7 +160,7 @@ To add a new test there, create a new directory and add the files:
165
160
` clippy.toml ` file.
166
161
167
162
The potential ` .stderr ` and ` .fixed ` files can again be generated with `cargo
168
- dev bless`.
163
+ bless`.
169
164
170
165
## Cargo Lints
171
166
@@ -209,7 +204,7 @@ compare that to the contents of a `.fixed` file.
209
204
We'll talk about suggestions more in depth in a later chapter.
210
205
<!-- FIXME: (blyxyas) Link to "Emitting lints" when that gets merged -->
211
206
212
- Use ` cargo dev bless ` to automatically generate the ` .fixed ` file after running
207
+ Use ` cargo bless ` to automatically generate the ` .fixed ` file after running
213
208
the tests.
214
209
215
210
[ rustfix ] : https://github.com/rust-lang/rustfix
0 commit comments