aboutsummaryrefslogtreecommitdiff
path: root/xtask/tests
diff options
context:
space:
mode:
Diffstat (limited to 'xtask/tests')
-rw-r--r--xtask/tests/tidy.rs37
1 files changed, 26 insertions, 11 deletions
diff --git a/xtask/tests/tidy.rs b/xtask/tests/tidy.rs
index d65a2acbc..ebd42cef7 100644
--- a/xtask/tests/tidy.rs
+++ b/xtask/tests/tidy.rs
@@ -44,11 +44,26 @@ 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
53fn deny_clippy(path: &PathBuf, text: &String) {
54 if text.contains("[\u{61}llow(clippy") {
55 panic!(
56 "\n\nallowing lints is forbidden: {}.
57rust-analyzer intentionally doesn't check clippy on CI.
58You can allow lint globally via `xtask clippy`.
59See https://github.com/rust-lang/rust-clippy/issues/5537 for discussion.
60
61",
62 path.display()
63 )
64 }
65}
66
52#[test] 67#[test]
53fn check_licenses() { 68fn check_licenses() {
54 let expected = " 69 let expected = "
@@ -67,7 +82,7 @@ MIT/Apache-2.0
67MIT/Apache-2.0 AND BSD-2-Clause 82MIT/Apache-2.0 AND BSD-2-Clause
68Unlicense OR MIT 83Unlicense OR MIT
69Unlicense/MIT 84Unlicense/MIT
70Zlib 85Zlib OR Apache-2.0 OR MIT
71" 86"
72 .lines() 87 .lines()
73 .filter(|it| !it.is_empty()) 88 .filter(|it| !it.is_empty())
@@ -177,16 +192,16 @@ impl TidyDocs {
177 } 192 }
178 193
179 let poorly_documented = [ 194 let poorly_documented = [
180 "ra_hir", 195 "hir",
181 "ra_hir_expand", 196 "hir_expand",
182 "ra_ide", 197 "ide",
183 "ra_mbe", 198 "mbe",
184 "ra_parser", 199 "parser",
185 "ra_prof", 200 "profile",
186 "ra_project_model", 201 "project_model",
187 "ra_syntax", 202 "syntax",
188 "ra_tt", 203 "tt",
189 "ra_hir_ty", 204 "hir_ty",
190 ]; 205 ];
191 206
192 let mut has_fixmes = 207 let mut has_fixmes =