diff options
author | Aleksey Kladov <[email protected]> | 2020-08-12 11:45:38 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-08-12 11:49:48 +0100 |
commit | 49af51129b943784a3e6dbe33b05b6f683965b28 (patch) | |
tree | bf9ddccb208bf35364dd8b5f39d237632f89f896 | |
parent | b27d5233bb3d68ae27e97879c85e5a8851d0501e (diff) |
Deny clippy
-rw-r--r-- | crates/ra_parser/src/grammar/expressions.rs | 1 | ||||
-rw-r--r-- | xtask/tests/tidy.rs | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/expressions.rs b/crates/ra_parser/src/grammar/expressions.rs index e1c25a838..51eaf7af6 100644 --- a/crates/ra_parser/src/grammar/expressions.rs +++ b/crates/ra_parser/src/grammar/expressions.rs | |||
@@ -509,7 +509,6 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | |||
509 | // x.1i32; | 509 | // x.1i32; |
510 | // x.0x01; | 510 | // x.0x01; |
511 | // } | 511 | // } |
512 | #[allow(clippy::if_same_then_else)] | ||
513 | fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { | 512 | fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker { |
514 | assert!(p.at(T![.])); | 513 | assert!(p.at(T![.])); |
515 | let m = lhs.precede(p); | 514 | let m = lhs.precede(p); |
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs index d65a2acbc..ca2301021 100644 --- a/xtask/tests/tidy.rs +++ b/xtask/tests/tidy.rs | |||
@@ -44,11 +44,25 @@ fn rust_files_are_tidy() { | |||
44 | let text = fs2::read_to_string(&path).unwrap(); | 44 | let text = fs2::read_to_string(&path).unwrap(); |
45 | check_todo(&path, &text); | 45 | check_todo(&path, &text); |
46 | check_trailing_ws(&path, &text); | 46 | check_trailing_ws(&path, &text); |
47 | deny_clippy(&path, &text); | ||
47 | tidy_docs.visit(&path, &text); | 48 | tidy_docs.visit(&path, &text); |
48 | } | 49 | } |
49 | tidy_docs.finish(); | 50 | tidy_docs.finish(); |
50 | } | 51 | } |
51 | 52 | ||
53 | fn deny_clippy(path: &PathBuf, text: &String) { | ||
54 | if text.contains("[\u{61}llow(clippy") { | ||
55 | panic!( | ||
56 | "\n\nallowing lints is forbidden: {}. | ||
57 | rust-analyzer intentionally doesn't check clippy on CI. | ||
58 | You can allow lint globally via `xtask clippy`. | ||
59 | |||
60 | ", | ||
61 | path.display() | ||
62 | ) | ||
63 | } | ||
64 | } | ||
65 | |||
52 | #[test] | 66 | #[test] |
53 | fn check_licenses() { | 67 | fn check_licenses() { |
54 | let expected = " | 68 | let expected = " |