5718: Deny clippy

 r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-08-12 10:51:02 +00:00 committed by GitHub
commit e471cb2a12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 = "