@@ -43,7 +43,7 @@ case), and we don't need type information so it will have an early pass type
43
43
(category will default to nursery if not provided). This command will create
44
44
two files: ` tests/ui/foo_functions.rs ` and ` clippy_lints/src/foo_functions.rs ` ,
45
45
as well as run ` cargo dev update_lints ` to register the new lint. For cargo lints,
46
- two project hierarchies (fail/pass) will be created under ` tests/ui-cargo ` .
46
+ two project hierarchies (fail/pass) will be created by default under ` tests/ui-cargo ` .
47
47
48
48
Next, we'll open up these files and add our lint!
49
49
@@ -110,12 +110,17 @@ specific lint you are creating/editing.
110
110
### Cargo lints
111
111
112
112
For cargo lints, the process of testing differs in that we are interested in
113
- the contents of the ` Cargo.toml ` files. If our new lint is named e.g. ` foo_categories ` ,
114
- after running ` cargo dev new_lint ` we will find two new manifest files:
113
+ the ` Cargo.toml ` manifest file. We also need a minimal crate associated
114
+ with that manifest.
115
+
116
+ If our new lint is named e.g. ` foo_categories ` , after running ` cargo dev new_lint `
117
+ we will find by default two new crates, each with its manifest file:
115
118
116
119
* ` tests/ui-cargo/foo_categories/fail/Cargo.toml ` : this file should cause the new lint to raise an error.
117
120
* ` tests/ui-cargo/foo_categories/pass/Cargo.toml ` : this file should not trigger the lint.
118
121
122
+ If you need more cases, you can copy one of those crates (under ` foo_categories ` ) and rename it.
123
+
119
124
The process of generating the ` .stderr ` file is the same, and prepending the ` TESTNAME `
120
125
variable to ` cargo uitest ` works too, but the script to update the references
121
126
is in another path: ` tests/ui-cargo/update-all-references.sh ` .
0 commit comments