Don't print all modified files if there's more than 10

This avoids spam for dozens of modified files.
This commit is contained in:
Joshua Nelson 2023-03-05 15:05:59 +00:00
parent 5423745db8
commit eb9b031232

View File

@ -159,8 +159,14 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
if !check && paths.is_empty() {
match get_modified_rs_files(build) {
Ok(Some(files)) => {
if files.len() <= 10 {
for file in &files {
println!("formatting modified file {file}");
}
} else {
println!("formatting {} modified files", files.len());
}
for file in files {
println!("formatting modified file {file}");
ignore_fmt.add(&format!("/{file}")).expect(&file);
}
}