Skip to content

Commit d376d74

Browse files
committed
skip formatting if no files have been modified
Signed-off-by: onur-ozkan <[email protected]>
1 parent f0a811c commit d376d74

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/bootstrap/src/core/build_steps/format.rs

+5
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
200200
adjective = Some("modified");
201201
match get_modified_rs_files(build) {
202202
Ok(Some(files)) => {
203+
if files.is_empty() {
204+
println!("fmt info: No modified files detected for formatting.");
205+
return;
206+
}
207+
203208
for file in files {
204209
override_builder.add(&format!("/{file}")).expect(&file);
205210
}

0 commit comments

Comments
 (0)