Skip to content

Commit 3d1062c

Browse files
Allow to negate ignored files
1 parent 79734f1 commit 3d1062c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/bootstrap/src/core/build_steps/format.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
115115
let rustfmt_config: RustfmtConfig = t!(toml::from_str(&rustfmt_config));
116116
let mut fmt_override = ignore::overrides::OverrideBuilder::new(&build.src);
117117
for ignore in rustfmt_config.ignore {
118-
fmt_override.add(&format!("!{ignore}")).expect(&ignore);
118+
if let Some(ignore) = ignore.strip_prefix('!') {
119+
fmt_override.add(ignore).expect(ignore);
120+
} else {
121+
fmt_override.add(&format!("!{ignore}")).expect(&ignore);
122+
}
119123
}
120124
let git_available = match Command::new("git")
121125
.arg("--version")

0 commit comments

Comments
 (0)