]> git.lizzy.rs Git - rust.git/blobdiff - CONTRIBUTING.md
Bump to 0.0.137
[rust.git] / CONTRIBUTING.md
index d7b181c8bdba75e9969a9a0a6dcd1e04ab326f2c..0b3b48a2cf7fcf038b30d4ff13e2a946ec707092 100644 (file)
@@ -31,24 +31,36 @@ the lint will end up to be a nested series of matches and ifs,
 [like so](https://github.com/Manishearth/rust-clippy/blob/de5ccdfab68a5e37689f3c950ed1532ba9d652a0/src/misc.rs#L34).
 
 T-middle issues can be more involved and require verifying types. The
-[`ty`](http://manishearth.github.io/rust-internals-docs/rustc/middle/ty) module contains a
+[`ty`](http://manishearth.github.io/rust-internals-docs/rustc/ty) module contains a
 lot of methods that are useful, though one of the most useful would be `expr_ty` (gives the type of
 an AST expression). `match_def_path()` in Clippy's `utils` module can also be useful.
 
-Should you add a lint, try it on clippy itself using `util/dogfood.sh`. You may find that clippy
-contains some questionable code itself! Also before making a pull request, please run
-`util/update_lints.py`, which will update `lib.rs` and `README.md` with the lint declarations. Our
-travis build actually checks for this.
+Compiling clippy can take almost a minute or more depending on your machine.
+You can set the environment flag `CARGO_INCREMENTAL=1` to cut down that time to
+almost a third on average, depending on the influence your change has.
+
+Clippy uses its own version of UI tests. Run `cargo test examples` to run only the ui tests.
+This will update all the `*.stderr` files in `clippy_tests/examples`. You need to check
+the stderr files whether they look as you expected them and commit them together with your
+changes.
+When you want to test a new lint, just create a new file in `clippy_tests/examples` and
+rerun `cargo test examples`.
+
+You can check just one example by running `cargo run --example example_name` inside the
+`clippy_tests` directory.
 
 Also please document your lint with a doc comment akin to the following:
-```
-/// **What it does:** Describe what the lint matches.
+```rust
+/// **What it does:** Checks for ... (describe what the lint matches).
 ///
-/// **Why is this bad?** Write the reason for linting the code.
+/// **Why is this bad?** Supply the reason for linting the code.
 ///
-/// **Known problems:** Hopefully none.
+/// **Known problems:** None. (Or describe where it could go wrong.)
 ///
-/// **Example:** Insert a short example if you have one
+/// **Example:**
+/// ```rust
+/// Insert a short example if you have one.
+/// ```
 ```
 
 Our `util/update_wiki.py` script can then add your lint docs to the wiki.