Skip to content

Commit 69f0cb6

Browse files
bors[bot]bnjjj
andauthored
Merge #4008
4008: tests: add more info about what failed in tidy tests r=matklad a=bnjjj Separate PR from #3954 Co-authored-by: Benjamin Coenen <[email protected]>
2 parents d426462 + 828f69c commit 69f0cb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

xtask/tests/tidy-tests/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn check_todo(path: &Path, text: &str) {
3535
}
3636
if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") {
3737
panic!(
38-
"\nTODO markers should not be committed to the master branch,\n\
38+
"\nTODO markers or todo! macros should not be committed to the master branch,\n\
3939
use FIXME instead\n\
4040
{}\n",
4141
path.display(),
@@ -47,9 +47,9 @@ fn check_trailing_ws(path: &Path, text: &str) {
4747
if is_exclude_dir(path, &["test_data"]) {
4848
return;
4949
}
50-
for line in text.lines() {
50+
for (line_number, line) in text.lines().enumerate() {
5151
if line.chars().last().map(char::is_whitespace) == Some(true) {
52-
panic!("Trailing whitespace in {}", path.display())
52+
panic!("Trailing whitespace in {} at line {}", path.display(), line_number)
5353
}
5454
}
5555
}

0 commit comments

Comments
 (0)