4008: tests: add more info about what failed in tidy tests r=matklad a=bnjjj

Separate PR from #3954

Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
This commit is contained in:
bors[bot] 2020-04-17 08:40:02 +00:00 committed by GitHub
commit 69f0cb6cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ fn check_todo(path: &Path, text: &str) {
}
if text.contains("TODO") || text.contains("TOOD") || text.contains("todo!") {
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\
{}\n",
path.display(),
@ -47,9 +47,9 @@ fn check_trailing_ws(path: &Path, text: &str) {
if is_exclude_dir(path, &["test_data"]) {
return;
}
for line in text.lines() {
for (line_number, line) in text.lines().enumerate() {
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)
}
}
}