Skip to content

Commit 3f978af

Browse files
committed
Update CONTRIBUTING.md for rustfix tests
1 parent 7d9bf99 commit 3f978af

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
156156
`cargo test`) and check whether the output looks as you expect with `git diff`. Commit all
157157
`*.stderr` files, too.
158158

159+
If the lint you are working on is making use of structured suggestions, the
160+
test file should include a `// run-rustfix` comment at the top. This will
161+
additionally run [rustfix](https://github.com/rust-lang-nursery/rustfix) for
162+
that test. Rustfix will apply the suggestions from the lint to the code of the
163+
test file and compare that to the contents of a `.fixed` file.
164+
165+
Use `tests/ui/update-all-references.sh` to automatically generate the
166+
`.fixed` file after running `cargo test`.
167+
159168
### Running rustfmt
160169

161170
[Rustfmt](https://github.com/rust-lang/rustfmt) is a tool for formatting Rust code according

0 commit comments

Comments
 (0)