vfmt: only print non-empty diffs (#9803)

pull/9805/head
Lukas Neubert 2021-04-19 17:55:55 +02:00 committed by GitHub
parent 70c651ff17
commit 4b230d16b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -210,7 +210,10 @@ fn (foptions &FormatOptions) post_process_file(file string, formatted_file_path
if foptions.is_verbose {
eprintln('Using diff command: $diff_cmd')
}
println(util.color_compare_files(diff_cmd, file, formatted_file_path))
diff := util.color_compare_files(diff_cmd, file, formatted_file_path)
if diff.len > 0 {
println(diff)
}
return
}
if foptions.is_verify {