Port clippy away from compiletest to ui_test Reasons to do this: * runs completely on stable Rust * is easier to extend with new features * has its own dogfood test suite, so changes can be tested in [the `ui_test` repo](https://github.com/oli-obk/ui_test) * supports dependencies from crates.io without having to manually fiddle with command line flags * supports `ui-cargo`, `ui`, `ui-toml` out of the box, no need to find and run the tests ourselves One thing that is a big difference to `compiletest` is that if a test emits *any* error, you need to mark all of them with `//~ ERROR:` annotations. Since many clippy tests did not have annotations, I changed many lints to be `warn` in their test so that only the `stderr` output is tested. TODO: * [ ] check that this still works as a subtree in the rustc repo changelog: none <!-- changelog_checked --> Note: at present the latest changes needed for clippy are only available as a git dependency, but I expect to publish a new crates.io version soon |
||
|---|---|---|
| .. | ||
| continuous_integration | ||
| development | ||
| configuration.md | ||
| installation.md | ||
| lint_configuration.md | ||
| lints.md | ||
| README.md | ||
| SUMMARY.md | ||
| usage.md | ||
Clippy
A collection of lints to catch common mistakes and improve your Rust code.
There are over 600 lints included in this crate!
Lints are divided into categories, each with a default lint
level. You can choose how
much Clippy is supposed to annoy help you by changing the lint level by
category.
| Category | Description | Default level |
|---|---|---|
clippy::all |
all lints that are on by default (correctness, suspicious, style, complexity, perf) | warn/deny |
clippy::correctness |
code that is outright wrong or useless | deny |
clippy::suspicious |
code that is most likely wrong or useless | warn |
clippy::complexity |
code that does something simple but in a complex way | warn |
clippy::perf |
code that can be written to run faster | warn |
clippy::style |
code that should be written in a more idiomatic way | warn |
clippy::pedantic |
lints which are rather strict or might have false positives | allow |
clippy::nursery |
new lints that are still under development | allow |
clippy::cargo |
lints for the cargo manifest | allow |
More to come, please file an issue if you have ideas!
The lint list also contains "restriction lints", which are for things which are usually not considered "bad", but may be useful to turn on in specific cases. These should be used very selectively, if at all.