mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 10:55:14 +00:00
skip formatting if no files have been modified
Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
parent
35ce85e0fd
commit
0a7f9e2134
@ -200,6 +200,11 @@ pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
|
|||||||
adjective = Some("modified");
|
adjective = Some("modified");
|
||||||
match get_modified_rs_files(build) {
|
match get_modified_rs_files(build) {
|
||||||
Ok(Some(files)) => {
|
Ok(Some(files)) => {
|
||||||
|
if files.is_empty() {
|
||||||
|
println!("fmt info: No modified files detected for formatting.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for file in files {
|
for file in files {
|
||||||
override_builder.add(&format!("/{file}")).expect(&file);
|
override_builder.add(&format!("/{file}")).expect(&file);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user