Skip to content

Commit

Permalink
Print an empty line before final stats to separate from error output
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Nov 29, 2024
1 parent 6a251ea commit 47a75bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ $ unicop example-files/homoglyph.js example-files/invisible.js example-files/not
6 │ ];
╰────
Error while scanning example-files/not-utf-8-file.ts: Failed to read file (stream did not contain valid UTF-8)

Scanned 486 unicode code points in 2 files, resulting in 3 rule violations
Failed to scan 1 file

Expand Down
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ fn main() -> anyhow::Result<()> {
}
}

// If any errors have been reported, print an empty line. Visually separates
// the below stats summary from the above error printing
if global_scan_stats.num_rule_violations > 0 || num_failed_files > 0 {
println!("");
}
println!(
"Scanned {} unicode code points in {} files, resulting in {} rule violations",
global_scan_stats.num_unicode_code_points,
Expand Down

0 comments on commit 47a75bb

Please sign in to comment.