Skip to content
Browse files

Do not run if rustfmt.toml does not exist

distcheck (and generally publishing tarballs) will not package
rustfmt.toml and we for now still support running tidy etc in those
  • Loading branch information
Mark-Simulacrum committed Dec 22, 2019
1 parent dddd872 commit b9e4174d8cf03fdcd0f9f128422b1f565d6b6607
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/bootstrap/
@@ -37,8 +37,13 @@ pub fn format(build: &Build, check: bool) {
let matcher =;

let rustfmt_config = t!(std::fs::read_to_string(build.src.join("rustfmt.toml")));
let rustfmt_config = build.src.join("rustfmt.toml");
if !rustfmt_config.exists() {
eprintln!("Not running formatting checks; rustfmt.toml does not exist.");
eprintln!("This may happen in distributed tarballs.");
let rustfmt_config = t!(std::fs::read_to_string(&rustfmt_config));
let rustfmt_config: RustfmtConfig = t!(toml::from_str(&rustfmt_config));
let mut ignore_fmt = ignore::overrides::OverrideBuilder::new(&build.src);
for ignore in rustfmt_config.ignore {

0 comments on commit b9e4174

Please sign in to comment.
You can’t perform that action at this time.