mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-03 18:43:38 +00:00
Deny clippy
This commit is contained in:
parent
b27d5233bb
commit
49af51129b
@ -509,7 +509,6 @@ fn method_call_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
|||||||
// x.1i32;
|
// x.1i32;
|
||||||
// x.0x01;
|
// x.0x01;
|
||||||
// }
|
// }
|
||||||
#[allow(clippy::if_same_then_else)]
|
|
||||||
fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
fn field_expr(p: &mut Parser, lhs: CompletedMarker) -> CompletedMarker {
|
||||||
assert!(p.at(T![.]));
|
assert!(p.at(T![.]));
|
||||||
let m = lhs.precede(p);
|
let m = lhs.precede(p);
|
||||||
|
@ -44,11 +44,25 @@ fn rust_files_are_tidy() {
|
|||||||
let text = fs2::read_to_string(&path).unwrap();
|
let text = fs2::read_to_string(&path).unwrap();
|
||||||
check_todo(&path, &text);
|
check_todo(&path, &text);
|
||||||
check_trailing_ws(&path, &text);
|
check_trailing_ws(&path, &text);
|
||||||
|
deny_clippy(&path, &text);
|
||||||
tidy_docs.visit(&path, &text);
|
tidy_docs.visit(&path, &text);
|
||||||
}
|
}
|
||||||
tidy_docs.finish();
|
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]
|
#[test]
|
||||||
fn check_licenses() {
|
fn check_licenses() {
|
||||||
let expected = "
|
let expected = "
|
||||||
|
Loading…
Reference in New Issue
Block a user