# Change Log
All notable changes to this project will be documented in this file.
+## 0.0.74 — TBR
+* Add the `CLIPPY_DISABLE_WIKI_LINKS` environment variable to deactivate the
+ “for further information visit *wiki-link*” message.
+
## 0.0.73 — 2016-06-05
* Fix false positives in [`useless_let_if_seq`]
#![plugin(clippy(conf_file="path/to/clippy's/configuration"))]
```
+To deactivate the “for further information visit *wiki-link*” message you can
+define the `CLIPPY_DISABLE_WIKI_LINKS` environment variable.
+
## Link with clippy service
`clippy-service` is a rust web initiative providing `rust-clippy` as a web service.
use rustc::ty::subst::Subst;
use rustc::ty;
use std::borrow::Cow;
+use std::env;
use std::mem;
use std::ops::{Deref, DerefMut};
use std::str::FromStr;
impl<'a> DiagnosticWrapper<'a> {
fn wiki_link(&mut self, lint: &'static Lint) {
- self.help(&format!("for further information visit https://github.com/Manishearth/rust-clippy/wiki#{}",
- lint.name_lower()));
+ if env::var("CLIPPY_DISABLE_WIKI_LINKS").is_err() {
+ self.help(&format!("for further information visit https://github.com/Manishearth/rust-clippy/wiki#{}",
+ lint.name_lower()));
+ }
}
}
let d: bool = unimplemented!();
let e: bool = unimplemented!();
let _ = a && b || a; //~ ERROR this boolean expression contains a logic bug
- //~| HELP for further information visit
//~| HELP this expression can be optimized out
//~| HELP it would look like the following
//~| SUGGESTION let _ = a;
let _ = !(a && b);
let _ = !true; //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = false;
let _ = !false; //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = true;
let _ = !!a; //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = a;
let _ = false && a; //~ ERROR this boolean expression contains a logic bug
- //~| HELP for further information visit
//~| HELP this expression can be optimized out
//~| HELP it would look like the following
//~| SUGGESTION let _ = false;
let _ = false || a; //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = a;
// don't lint on cfgs
let _ = !(a && b || c);
let _ = !(!a && b); //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = !b || a;
}
let d: i32 = unimplemented!();
let e: i32 = unimplemented!();
let _ = a == b && a != b; //~ ERROR this boolean expression contains a logic bug
- //~| HELP for further information visit
//~| HELP this expression can be optimized out
//~| HELP it would look like the following
//~| SUGGESTION let _ = false;
let _ = a == b && c == 5 && a == b; //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = a == b && c == 5;
let _ = a == b && c == 5 && b == a; //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = a == b && c == 5;
//~| HELP try
//~| SUGGESTION let _ = !(c != 5 || a != b);
let _ = a < b && a >= b; //~ ERROR this boolean expression contains a logic bug
- //~| HELP for further information visit
//~| HELP this expression can be optimized out
//~| HELP it would look like the following
//~| SUGGESTION let _ = false;
let _ = a > b && a <= b; //~ ERROR this boolean expression contains a logic bug
- //~| HELP for further information visit
//~| HELP this expression can be optimized out
//~| HELP it would look like the following
//~| SUGGESTION let _ = false;
let _ = a > b && a == b;
let _ = a != b || !(a != b || c == d); //~ ERROR this boolean expression can be simplified
- //~| HELP for further information visit
+ //~| HELP try
//~| SUGGESTION let _ = c != d || a != b;
//~| HELP try
//~| SUGGESTION let _ = !(a == b && c == d);
//~^ NOTE: existing binding defined here
let bpple: i32; //~ ERROR: name is too similar
//~| HELP: separate the discriminating character by an underscore like: `b_pple`
- //~| HELP: for further information visit
let cpple: i32; //~ ERROR: name is too similar
//~| HELP: separate the discriminating character by an underscore like: `c_pple`
- //~| HELP: for further information visit
let a_bar: i32;
let b_bar: i32;
let blubx: i32; //~ NOTE: existing binding defined here
let bluby: i32; //~ ERROR: name is too similar
- //~| HELP: for further information visit
//~| HELP: separate the discriminating character by an underscore like: `blub_y`
let cake: i32; //~ NOTE: existing binding defined here
let cakes: i32;
let coke: i32; //~ ERROR: name is too similar
- //~| HELP: for further information visit
match 5 {
cheese @ 1 => {},
let xyz1abc: i32; //~ NOTE: existing binding defined here
let xyz2abc: i32;
let xyzeabc: i32; //~ ERROR: name is too similar
- //~| HELP: for further information visit
let parser: i32; //~ NOTE: existing binding defined here
let parsed: i32;
let parsee: i32; //~ ERROR: name is too similar
- //~| HELP: for further information visit
//~| HELP: separate the discriminating character by an underscore like: `parse_e`
let setter: i32;
let Foo { apple, bpple } = unimplemented!();
let Foo { apple: spring, //~NOTE existing binding defined here
bpple: sprang } = unimplemented!(); //~ ERROR: name is too similar
- //~^HELP for further information
}
#[derive(Clone, Debug)]
}
{
let e: i32; //~ ERROR: 5th binding whose name is just one char
- //~| HELP: for further information visit
}
{
let e: i32; //~ ERROR: 5th binding whose name is just one char
- //~| HELP: for further information visit
let f: i32; //~ ERROR: 6th binding whose name is just one char
- //~| HELP: for further information visit
}
match 5 {
1 => println!(""),
e => panic!(), //~ ERROR: 5th binding whose name is just one char
- //~| HELP: for further information visit
}
match 5 {
1 => println!(""),
extern crate compiletest_rs as compiletest;
use std::path::PathBuf;
-use std::env::{var, temp_dir};
+use std::env::{set_var, var, temp_dir};
fn run_mode(dir: &'static str, mode: &'static str) {
let mut config = compiletest::default_config();
compiletest::run_tests(&config);
}
+fn prepare_env() {
+ set_var("CLIPPY_DISABLE_WIKI_LINKS", "true");
+}
+
#[test]
#[cfg(not(feature = "test-regex_macros"))]
fn compile_test() {
+ prepare_env();
run_mode("run-pass", "run-pass");
run_mode("compile-fail", "compile-fail");
}
#[test]
#[cfg(feature = "test-regex_macros")]
fn compile_test() {
+ prepare_env();
run_mode("run-pass-regex_macros", "run-pass");
run_mode("compile-fail-regex_macros", "compile-fail");
}