From 47a75bb8363676f2581568a3ffa9a76a5abf7f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Fri, 29 Nov 2024 16:06:12 +0100 Subject: [PATCH] Print an empty line before final stats to separate from error output --- README.md | 1 + src/main.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 55e68c2..9db91a8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/main.rs b/src/main.rs index 95bc76c..9e9a35f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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,