mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-22 12:43:18 +00:00
Change contrib.md hierarchy, link to it from readme
'How Clippy works' and 'How to fix nightly failures' are not exactly part of 'Writing code'.
This commit is contained in:
parent
a416c5e0f7
commit
ff634e2350
2 changed files with 6 additions and 4 deletions
|
@ -19,8 +19,8 @@ All contributors are expected to follow the [Rust Code of Conduct](http://www.ru
|
|||
* [Running test suite](#running-test-suite)
|
||||
* [Running rustfmt](#running-rustfmt)
|
||||
* [Testing manually](#testing-manually)
|
||||
* [How Clippy works](#how-clippy-works)
|
||||
* [Fixing nightly build failures](#fixing-build-failures-caused-by-rust)
|
||||
* [How Clippy works](#how-clippy-works)
|
||||
* [Fixing nightly build failures](#fixing-build-failures-caused-by-rust)
|
||||
* [Issue and PR Triage](#issue-and-pr-triage)
|
||||
* [Bors and Homu](#bors-and-homu)
|
||||
* [Contributions](#contributions)
|
||||
|
@ -168,7 +168,7 @@ Manually testing against an example file is useful if you have added some
|
|||
local modifications, run `env CLIPPY_TESTS=true cargo run --bin clippy-driver -- -L ./target/debug input.rs`
|
||||
from the working copy root.
|
||||
|
||||
### How Clippy works
|
||||
## How Clippy works
|
||||
|
||||
Clippy is a [rustc compiler plugin][compiler_plugin]. The main entry point is at [`src/lib.rs`][main_entry]. In there, the lint registration is delegated to the [`clippy_lints`][lint_crate] crate.
|
||||
|
||||
|
@ -218,7 +218,7 @@ The difference between `EarlyLintPass` and `LateLintPass` is that the methods of
|
|||
|
||||
That's why the `else_if_without_else` example uses the `register_early_lint_pass` function. Because the [actual lint logic][else_if_without_else] does not depend on any type information.
|
||||
|
||||
### Fixing build failures caused by Rust
|
||||
## Fixing build failures caused by Rust
|
||||
|
||||
Clippy will sometimes fail to build from source because building it depends on unstable internal Rust features. Most of the times we have to adapt to the changes and only very rarely there's an actual bug in Rust. Fixing build failures caused by Rust updates, can be a good way to learn about Rust internals.
|
||||
|
||||
|
|
|
@ -151,6 +151,8 @@ Note: `deny` produces errors instead of warnings.
|
|||
|
||||
If you do not want to include your lint levels in your code, you can globally enable/disable lints by passing extra flags to Clippy during the run: `cargo clippy -- -A clippy::lint_name` will run Clippy with `lint_name` disabled and `cargo clippy -- -W clippy::lint_name` will run it with that enabled. This also works with lint groups. For example you can run Clippy with warnings for all lints enabled: `cargo clippy -- -W clippy::pedantic`
|
||||
|
||||
## [Contributing](https://github.com/rust-lang/rust-clippy/blob/master/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
|
||||
Copyright 2014-2018 The Rust Project Developers
|
||||
|
|
Loading…
Reference in a new issue