From 1b6675a607bf0987b4e9688d783d80356d12ec00 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 14 Oct 2024 01:01:51 +0200 Subject: [PATCH] cleanup --- lychee-bin/Cargo.toml | 2 +- lychee-bin/src/formatters/response/color.rs | 1 - lychee-bin/src/formatters/response/mod.rs | 5 +++-- lychee-bin/src/formatters/stats/compact.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lychee-bin/Cargo.toml b/lychee-bin/Cargo.toml index 4342112422..2baf6d35ad 100644 --- a/lychee-bin/Cargo.toml +++ b/lychee-bin/Cargo.toml @@ -100,4 +100,4 @@ required-features = ["check_example_domains"] [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ archive-suffix }" bin-dir = "{ bin }{ binary-ext }" -pkg-fmt = "tgz" \ No newline at end of file +pkg-fmt = "tgz" diff --git a/lychee-bin/src/formatters/response/color.rs b/lychee-bin/src/formatters/response/color.rs index 1349171dcd..824a2f2ac2 100644 --- a/lychee-bin/src/formatters/response/color.rs +++ b/lychee-bin/src/formatters/response/color.rs @@ -74,7 +74,6 @@ mod tests { use lychee_lib::{ErrorKind, Status, Uri}; use pretty_assertions::assert_eq; - #[cfg(test)] /// Helper function to strip ANSI color codes for tests fn strip_ansi_codes(s: &str) -> String { console::strip_ansi_codes(s).to_string() diff --git a/lychee-bin/src/formatters/response/mod.rs b/lychee-bin/src/formatters/response/mod.rs index 01ab4440ac..727324ff31 100644 --- a/lychee-bin/src/formatters/response/mod.rs +++ b/lychee-bin/src/formatters/response/mod.rs @@ -28,8 +28,9 @@ pub(crate) trait ResponseFormatter: Send + Sync { /// Detailed response formatter (defaults to the normal formatter) /// - /// This is used for some output modes to provide more detailed information - /// and in verbose mode. + /// This can be used for output modes which want to provide more detailed + /// information. It is also used if the output is set to verbose mode + /// (i.e. `-v`, `-vv` and above). fn format_detailed_response(&self, body: &ResponseBody) -> String { self.format_response(body) } diff --git a/lychee-bin/src/formatters/stats/compact.rs b/lychee-bin/src/formatters/stats/compact.rs index c76914d2bc..86969a36d2 100644 --- a/lychee-bin/src/formatters/stats/compact.rs +++ b/lychee-bin/src/formatters/stats/compact.rs @@ -153,7 +153,7 @@ mod tests { let stats = ResponseStats { total: 1, successful: 1, - errors: 0, + errors: 2, unknown: 0, excludes: 0, timeouts: 0, @@ -176,7 +176,7 @@ mod tests { assert!(result.contains("🔍 1 Total")); assert!(result.contains("✅ 1 OK")); - assert!(result.contains("🚫 0 Errors")); + assert!(result.contains("🚫 2 Errors")); assert!(result.contains("[https://example.com/]:")); assert!(result