Rollup merge of #108778 - jyn514:quiet-fmt, r=albertlarsan68

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

This avoids spam for dozens of modified files.

Fixes https://github.com/rust-lang/rust/issues/106920.
This commit is contained in:
Matthias Krüger 2023-03-09 12:11:53 +01:00 committed by GitHub
commit aedd94fcab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,8 +165,14 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
if !CiEnv::is_ci() && paths.is_empty() {
match get_modified_rs_files(build) {
Ok(Some(files)) => {
for file in 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 {
ignore_fmt.add(&format!("/{file}")).expect(&file);
}
}