mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
tests: add more info about what failed in tidy tests
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
parent
8d296be109
commit
828f69ce54
1 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ fn check_todo(path: &Path, text: &str) {
|
||||||
}
|
}
|
||||||
if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") {
|
if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") {
|
||||||
panic!(
|
panic!(
|
||||||
"\nTODO markers should not be committed to the master branch,\n\
|
"\nTODO markers or todo! macros should not be committed to the master branch,\n\
|
||||||
use FIXME instead\n\
|
use FIXME instead\n\
|
||||||
{}\n",
|
{}\n",
|
||||||
path.display(),
|
path.display(),
|
||||||
|
@ -47,9 +47,9 @@ fn check_trailing_ws(path: &Path, text: &str) {
|
||||||
if is_exclude_dir(path, &["test_data"]) {
|
if is_exclude_dir(path, &["test_data"]) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for line in text.lines() {
|
for (line_number, line) in text.lines().enumerate() {
|
||||||
if line.chars().last().map(char::is_whitespace) == Some(true) {
|
if line.chars().last().map(char::is_whitespace) == Some(true) {
|
||||||
panic!("Trailing whitespace in {}", path.display())
|
panic!("Trailing whitespace in {} at line {}", path.display(), line_number)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue