about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-03-09 12:11:53 +0100
committerGitHub <noreply@github.com>2023-03-09 12:11:53 +0100
commitaedd94fcab685f7530b07745dbba196d501ecb5c (patch)
treef495c611ea0d6482e9d1221b417cc91a94345a0a /src
parentac258e9e02367e74f99f89f6f77b2364497431d5 (diff)
parenteb9b031232160063e1fb4b3a865607e6dcc95129 (diff)
downloadrust-aedd94fcab685f7530b07745dbba196d501ecb5c.tar.gz
rust-aedd94fcab685f7530b07745dbba196d501ecb5c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/format.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bootstrap/format.rs b/src/bootstrap/format.rs
index 5cb94c2f1d6..b79969663ca 100644
--- a/src/bootstrap/format.rs
+++ b/src/bootstrap/format.rs
@@ -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)) => {
+                        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);
                         }
                     }