Deny clippy

This commit is contained in:
Aleksey Kladov 2020-08-12 12:45:38 +02:00
parent b27d5233bb
commit 49af51129b
2 changed files with 14 additions and 1 deletions

View file

@ -509,7 +509,6 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
// x.1i32;
// x.0x01;
// }
#[allow(clippy::if_same_then_else)]
fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
assert!(p.at(T![.]));
let m = lhs.precede(p);

View file

@ -44,11 +44,25 @@ fn rust_files_are_tidy() {
let text = fs2::read_to_string(&path).unwrap();
check_todo(&path, &text);
check_trailing_ws(&path, &text);
deny_clippy(&path, &text);
tidy_docs.visit(&path, &text);
}
tidy_docs.finish();
}
fn deny_clippy(path: &PathBuf, text: &String) {
if text.contains("[\u{61}llow(clippy") {
panic!(
"\n\nallowing lints is forbidden: {}.
rust-analyzer intentionally doesn't check clippy on CI.
You can allow lint globally via `xtask clippy`.
",
path.display()
)
}
}
#[test]
fn check_licenses() {
let expected = "