@@ -1070,23 +1070,33 @@ impl Step for Tidy {
1070
1070
}
1071
1071
1072
1072
if builder. config . channel == "dev" || builder. config . channel == "nightly" {
1073
- builder. info ( "fmt check" ) ;
1074
- if builder. initial_rustfmt ( ) . is_none ( ) {
1075
- let inferred_rustfmt_dir = builder. initial_sysroot . join ( "bin" ) ;
1076
- eprintln ! (
1077
- "\
1073
+ if !builder. config . json_output {
1074
+ builder. info ( "fmt check" ) ;
1075
+ if builder. initial_rustfmt ( ) . is_none ( ) {
1076
+ let inferred_rustfmt_dir = builder. initial_sysroot . join ( "bin" ) ;
1077
+ eprintln ! (
1078
+ "\
1078
1079
ERROR: no `rustfmt` binary found in {PATH}
1079
1080
INFO: `rust.channel` is currently set to \" {CHAN}\"
1080
1081
HELP: if you are testing a beta branch, set `rust.channel` to \" beta\" in the `config.toml` file
1081
1082
HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to `x.py test`" ,
1082
- PATH = inferred_rustfmt_dir. display( ) ,
1083
- CHAN = builder. config. channel,
1083
+ PATH = inferred_rustfmt_dir. display( ) ,
1084
+ CHAN = builder. config. channel,
1085
+ ) ;
1086
+ crate :: exit!( 1 ) ;
1087
+ }
1088
+ let all = false ;
1089
+ crate :: core:: build_steps:: format:: format (
1090
+ builder,
1091
+ !builder. config . cmd . bless ( ) ,
1092
+ all,
1093
+ & [ ] ,
1094
+ ) ;
1095
+ } else {
1096
+ println ! (
1097
+ "WARNING: `--json-output` is not supported on rustfmt, formatting will be skipped"
1084
1098
) ;
1085
- crate :: exit!( 1 ) ;
1086
1099
}
1087
- let all = false ;
1088
- crate :: core:: build_steps:: format:: format ( builder, !builder. config . cmd . bless ( ) , all, & [
1089
- ] ) ;
1090
1100
}
1091
1101
1092
1102
builder. info ( "tidy check" ) ;
0 commit comments