mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-14 00:47:18 +00:00
Merge #5718
5718: Deny clippy
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
e471cb2a12
2 changed files with 14 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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 = "
|
||||
|
|
Loading…
Reference in a new issue