Skip to content

Commit

Permalink
Much better progress bars
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanpeach committed Dec 21, 2024
1 parent 46dc04b commit 0d5e892
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mdlinker"
version = "0.1.0"
version = "1.4.0"
edition = "2021"

[profile.dev]
Expand Down
13 changes: 10 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -141,7 +142,7 @@ fn fix(config: &config::Config) -> Result<OutputReport, OutputErrors> {
if env::var("RUNNING_TESTS").is_err() {
println!(
"{} {}Generating Error Reports...",
style("[1/2]").bold().dim(),
style("[1/3]").bold().dim(),
CHECK
);
};
Expand Down Expand Up @@ -192,6 +193,12 @@ fn fix(config: &config::Config) -> Result<OutputReport, OutputErrors> {
);
};
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)
Expand Down Expand Up @@ -234,7 +241,7 @@ fn check(config: &config::Config) -> Result<OutputReport, OutputErrors> {
None
} else {
println!(
"{} {}Getting Aliases O(n)...",
" {} {}Getting Aliases O(n)...",
style("[2/3]").bold().dim(),
FIRST_PASS
);
Expand Down Expand Up @@ -267,7 +274,7 @@ fn check(config: &config::Config) -> Result<OutputReport, OutputErrors> {
None
} else {
println!(
"{} {}Checking Links O(n)...",
" {} {}Checking Links O(n)...",
style("[3/3]").bold().dim(),
SECOND_PASS
);
Expand Down
2 changes: 1 addition & 1 deletion src/rules/similar_filename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit 0d5e892

Please sign in to comment.