From 30b3bc8d80e4f2d084ea560a7a196f1a39c54660 Mon Sep 17 00:00:00 2001 From: Wayne Warren Date: Wed, 21 Nov 2018 07:12:00 -0600 Subject: [PATCH 1/2] Document how to lint local Clippy changes with locally built Clippy --- CONTRIBUTING.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 50f61eb1e670..227e12e145c9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -152,6 +152,18 @@ 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. +### Running Clippy Against Clippy + +Clippy CI runs all lints defined in the version of the Clippy being tested pass +(that is, don’t report any suggestions). You can avoid prolonging the CI +feedback cycle for PRs you submit by running these lints yourself ahead of time +and addressing any issues found: + +``` +cargo build +`pwd`/target/debug/cargo-clippy clippy --all-targets --all-features -- -D clippy::all -D clippy::internal -D clippy::pedantic +``` + ### 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. From 4450b3e47a33e13b890e7e5b41084c89148fae72 Mon Sep 17 00:00:00 2001 From: Wayne Warren Date: Wed, 21 Nov 2018 07:16:03 -0600 Subject: [PATCH 2/2] Fix awkward wording --- CONTRIBUTING.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 227e12e145c9..bb0da592851d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -152,12 +152,12 @@ 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. -### Running Clippy Against Clippy +### Linting Clippy with your changes locally -Clippy CI runs all lints defined in the version of the Clippy being tested pass -(that is, don’t report any suggestions). You can avoid prolonging the CI -feedback cycle for PRs you submit by running these lints yourself ahead of time -and addressing any issues found: +Clippy CI only passes if all lints defined in the version of the Clippy being +tested pass (that is, don’t report any suggestions). You can avoid prolonging +the CI feedback cycle for PRs you submit by running these lints yourself ahead +of time and addressing any issues found: ``` cargo build