Skip to content

Commit

Permalink
XXX: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Oct 25, 2023
1 parent 8a24531 commit fc56c0c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tools/tidy/src/alphabetical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,20 @@ fn check_section<'a>(

pub fn check(path: &Path, bad: &mut bool) {
walk(path, |path, _is_dir| filter_dirs(path), &mut |entry, contents| {
let mut this_bad = false;
let file = &entry.path().display();

let mut lines = contents.lines().enumerate();
while let Some((_, line)) = lines.next() {
if line.contains(START_MARKER) {
check_section(file, &mut lines, bad);
check_section(file, &mut lines, &mut this_bad);
}
}
if this_bad {
eprintln!("<<<BAD: {file}");
eprint!("{contents}");
eprintln!(">>>BAD");
}
*bad = *bad || this_bad;
});
}

0 comments on commit fc56c0c

Please sign in to comment.