From 0d5e892c82c7818415cab16c4d2a63ac29574aa2 Mon Sep 17 00:00:00 2001 From: Ryan Peach Date: Sat, 21 Dec 2024 11:28:21 -0500 Subject: [PATCH] Much better progress bars --- Cargo.toml | 2 +- src/lib.rs | 13 ++++++++++--- src/rules/similar_filename.rs | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5846e6e..18089c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mdlinker" -version = "0.1.0" +version = "1.4.0" edition = "2021" [profile.dev] diff --git a/src/lib.rs b/src/lib.rs index 8359516..e837a30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -34,6 +34,7 @@ static SECOND_PASS: Emoji<'_, '_> = Emoji("🔗 ", ""); static CHECK: Emoji<'_, '_> = Emoji("🔍 ", ""); static FIXES: Emoji<'_, '_> = Emoji("🔧 ", ""); static CHECK_AGAIN: Emoji<'_, '_> = Emoji("💡 ", ""); +static NO_FIXES: Emoji<'_, '_> = Emoji("🎉 ", ""); impl OutputReport { /// Get if this is empty @@ -141,7 +142,7 @@ fn fix(config: &config::Config) -> Result { if env::var("RUNNING_TESTS").is_err() { println!( "{} {}Generating Error Reports...", - style("[1/2]").bold().dim(), + style("[1/3]").bold().dim(), CHECK ); }; @@ -192,6 +193,12 @@ fn fix(config: &config::Config) -> Result { ); }; output_report = check(config)?; + } else if env::var("RUNNING_TESTS").is_err() { + println!( + "{} {}No Fixes Found...", + style("[3/3]").bold().dim(), + NO_FIXES + ); } Ok(output_report) @@ -234,7 +241,7 @@ fn check(config: &config::Config) -> Result { None } else { println!( - "{} {}Getting Aliases O(n)...", + " {} {}Getting Aliases O(n)...", style("[2/3]").bold().dim(), FIRST_PASS ); @@ -267,7 +274,7 @@ fn check(config: &config::Config) -> Result { None } else { println!( - "{} {}Checking Links O(n)...", + " {} {}Checking Links O(n)...", style("[3/3]").bold().dim(), SECOND_PASS ); diff --git a/src/rules/similar_filename.rs b/src/rules/similar_filename.rs index 0432d98..78f59c4 100644 --- a/src/rules/similar_filename.rs +++ b/src/rules/similar_filename.rs @@ -156,7 +156,7 @@ impl SimilarFilename { None } else { println!( - "{} {}Searching for Similar Filenames O(n^2)...", + " {} {}Searching for Similar Filenames O(n^2)...", style("[1/3]").bold().dim(), SIMILAR );