about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hansch <dev@phansch.net>2018-12-09 17:01:51 +0100
committerPhilipp Hansch <dev@phansch.net>2018-12-28 20:53:44 +0100
commit3f978afe8d2260e29dbc593fa294ccaa39b0df32 (patch)
tree763a8313394c0f9a7dcc90af232219fd94f9c669
parent7d9bf99df14e04ab2d1158e3f06ecc3291145bf0 (diff)
downloadrust-3f978afe8d2260e29dbc593fa294ccaa39b0df32.tar.gz
rust-3f978afe8d2260e29dbc593fa294ccaa39b0df32.zip
Update CONTRIBUTING.md for rustfix tests
-rw-r--r--CONTRIBUTING.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 94120a3771a..df216a8fbc9 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -156,6 +156,15 @@ Therefore you should use `tests/ui/update-all-references.sh` (after running
 `cargo test`) and check whether the output looks as you expect with `git diff`. Commit all
 `*.stderr` files, too.
 
+If the lint you are working on is making use of structured suggestions, the
+test file should include a `// run-rustfix` comment at the top. This will
+additionally run [rustfix](https://github.com/rust-lang-nursery/rustfix) for
+that test. Rustfix will apply the suggestions from the lint to the code of the
+test file and compare that to the contents of a `.fixed` file.
+
+Use `tests/ui/update-all-references.sh` to automatically generate the
+`.fixed` file after running `cargo test`.
+
 ### Running rustfmt
 
 [Rustfmt](https://github.com/rust-lang/rustfmt) is a tool for formatting Rust code according