Skip to content

Commit

Permalink
skip formatting if no files have been modified
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Sep 10, 2024
1 parent f0a811c commit d376d74
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/bootstrap/src/core/build_steps/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
adjective = Some("modified");
match get_modified_rs_files(build) {
Ok(Some(files)) => {
if files.is_empty() {
println!("fmt info: No modified files detected for formatting.");
return;
}

for file in files {
override_builder.add(&format!("/{file}")).expect(&file);
}
Expand Down

0 comments on commit d376d74

Please sign in to comment.