File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,12 +265,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
265265 // If true, all input files were already formatted (used for check mode)
266266 let mut all_formatted = true ;
267267 let mut modified_file_count = 0 ;
268+ let mut unformatted_files = Vec :: new ( ) ;
268269 for output in sorted_outputs {
269270 match output {
270271 Ok ( output) => {
271272 if args. check {
272273 if !output. is_formatted {
273274 all_formatted = false ;
275+ unformatted_files. push ( output. file_path ) ;
274276 }
275277 } else if args. stdout {
276278 // Clear the progress message before printing formatted files to stdout
@@ -307,6 +309,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
307309 } else {
308310 terminal_clear_line ( ) ;
309311 eprintln ! ( "\r Some files are not formatted" ) ;
312+ for file_path in unformatted_files {
313+ eprintln ! ( "{}" , file_path. display( ) ) ;
314+ }
310315 std:: process:: exit ( 1 ) ;
311316 }
312317 } else if !args. stdout {
You can’t perform that action at this time.
0 commit comments