mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Also run alphabetical check in src and library
This commit is contained in:
parent
3c0062641d
commit
1b8012fa10
@ -29,7 +29,8 @@ fn is_close_bracket(c: char) -> bool {
|
||||
matches!(c, ')' | ']' | '}')
|
||||
}
|
||||
|
||||
const START_COMMENT: &str = "// tidy-alphabetical-start";
|
||||
// Don't let tidy check this here :D
|
||||
const START_COMMENT: &str = concat!("// tidy-alphabetical", "-start");
|
||||
const END_COMMENT: &str = "// tidy-alphabetical-end";
|
||||
|
||||
fn check_section<'a>(
|
||||
@ -47,7 +48,7 @@ fn check_section<'a>(
|
||||
if line.contains(START_COMMENT) {
|
||||
tidy_error!(
|
||||
bad,
|
||||
"{file}:{} found `// tidy-alphabetical-start` expecting `// tidy-alphabetical-end`",
|
||||
"{file}:{} found `{START_COMMENT}` expecting `{END_COMMENT}`",
|
||||
line_idx
|
||||
)
|
||||
}
|
||||
@ -102,10 +103,7 @@ pub fn check(path: &Path, bad: &mut bool) {
|
||||
if line.contains(START_COMMENT) {
|
||||
check_section(file, &mut lines, bad);
|
||||
if lines.peek().is_none() {
|
||||
tidy_error!(
|
||||
bad,
|
||||
"{file}: reached end of file expecting `// tidy-alphabetical-end`"
|
||||
)
|
||||
tidy_error!(bad, "{file}: reached end of file expecting `{END_COMMENT}`")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,7 +90,9 @@ fn main() {
|
||||
check!(edition, &compiler_path);
|
||||
check!(edition, &library_path);
|
||||
|
||||
check!(alphabetical, &src_path);
|
||||
check!(alphabetical, &compiler_path);
|
||||
check!(alphabetical, &library_path);
|
||||
|
||||
let collected = {
|
||||
while handles.len() >= concurrency.get() {
|
||||
|
Loading…
Reference in New Issue
Block a user