about summary refs log tree commit diff
diff options
context:
space:
mode:
authorflip1995 <philipp.krones@embecosm.com>2021-01-07 12:38:10 +0100
committerflip1995 <philipp.krones@embecosm.com>2021-01-07 12:38:10 +0100
commit547ce0db274c68869a300b5162c126f95f768dac (patch)
tree2321843df9a0bedcb7dbef578fcc574caeb1cb0b
parent8e5c5a64a5e6689ef25809d9b77380c912572060 (diff)
downloadrust-547ce0db274c68869a300b5162c126f95f768dac.tar.gz
rust-547ce0db274c68869a300b5162c126f95f768dac.zip
Change env var used for testing Clippy
This changes the variable used for testing Clippy in the internal test
suite:

```
CLIPPY_TESTS -> __CLIPPY_INTERNAL_TESTS
```

`CLIPPY_TESTS` is understandably used in environments of Clippy users,
so we shouldn't use it in our test suite.
-rw-r--r--doc/adding_lints.md10
-rw-r--r--src/driver.rs2
-rw-r--r--tests/compile-test.rs2
3 files changed, 9 insertions, 5 deletions
diff --git a/doc/adding_lints.md b/doc/adding_lints.md
index 60dfdb76650..1a7a30c61be 100644
--- a/doc/adding_lints.md
+++ b/doc/adding_lints.md
@@ -147,10 +147,14 @@ add `// edition:2018` at the top of the test file (note that it's space-sensitiv
 
 Manually testing against an example file can be useful if you have added some
 `println!`s and the test suite output becomes unreadable. To try Clippy with
-your local modifications, run `env CLIPPY_TESTS=true cargo run --bin
-clippy-driver -- -L ./target/debug input.rs` from the working copy root.
+your local modifications, run
 
-With tests in place, let's have a look at implementing our lint now.
+```
+env __CLIPPY_INTERNAL_TESTS=true cargo run --bin clippy-driver -- -L ./target/debug input.rs
+```
+
+from the working copy root. With tests in place, let's have a look at
+implementing our lint now.
 
 ## Lint declaration
 
diff --git a/src/driver.rs b/src/driver.rs
index e490ee54c0b..f5f6c09ed8e 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -298,7 +298,7 @@ pub fn main() {
         // - IF Clippy is run on the main crate, not on deps (`!cap_lints_allow`) THEN
         //    - IF `--no-deps` is not set (`!no_deps`) OR
         //    - IF `--no-deps` is set and Clippy is run on the specified primary package
-        let clippy_tests_set = env::var("CLIPPY_TESTS").map_or(false, |val| val == "true");
+        let clippy_tests_set = env::var("__CLIPPY_INTERNAL_TESTS").map_or(false, |val| val == "true");
         let cap_lints_allow = arg_value(&orig_args, "--cap-lints", |val| val == "allow").is_some();
         let in_primary_package = env::var("CARGO_PRIMARY_PACKAGE").is_ok();
 
diff --git a/tests/compile-test.rs b/tests/compile-test.rs
index ec3af94b9ca..ea800336ef5 100644
--- a/tests/compile-test.rs
+++ b/tests/compile-test.rs
@@ -254,7 +254,7 @@ fn run_ui_cargo(config: &mut compiletest::Config) {
 
 fn prepare_env() {
     set_var("CLIPPY_DISABLE_DOCS_LINKS", "true");
-    set_var("CLIPPY_TESTS", "true");
+    set_var("__CLIPPY_INTERNAL_TESTS", "true");
     //set_var("RUST_BACKTRACE", "0");
 }