Skip to content

Commit bbfb8b0

Browse files
authored
display unsupported URLs (lycheeverse#1727)
* display status for unsupported URLs * updates screengrab --------- Co-authored-by: Allen Hernandez <2349718+AllenSH12@users.noreply.github.com>
1 parent b970256 commit bbfb8b0

4 files changed

Lines changed: 27352 additions & 20 deletions

File tree

assets/screencast.svg

Lines changed: 27325 additions & 1 deletion
Loading

lychee-bin/src/formatters/stats/compact.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ impl Display for CompactResponseStats {
8080
write_if_any(stats.unknown, "❓", "Unknown", &BOLD_PINK, f)?;
8181
write_if_any(stats.excludes, "👻", "Excluded", &BOLD_YELLOW, f)?;
8282
write_if_any(stats.timeouts, "⏳", "Timeouts", &BOLD_YELLOW, f)?;
83+
write_if_any(stats.unsupported, "⛔", "Unsupported", &BOLD_YELLOW, f)?;
8384

8485
Ok(())
8586
}

lychee-bin/src/formatters/stats/detailed.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ impl Display for DetailedResponseStats {
4545
write_stat(f, "\u{1f500} Redirected", stats.redirects, true)?; // 🔀
4646
write_stat(f, "\u{1f47b} Excluded", stats.excludes, true)?; // 👻
4747
write_stat(f, "\u{2753} Unknown", stats.unknown, true)?; //❓
48-
write_stat(f, "\u{1f6ab} Errors", stats.errors, false)?; // 🚫
48+
write_stat(f, "\u{1f6ab} Errors", stats.errors, true)?; // 🚫
49+
write_stat(f, "\u{26d4} Unsupported", stats.errors, false)?; // ⛔
4950

5051
let response_formatter = get_response_formatter(&self.mode);
5152

lychee-bin/src/formatters/stats/markdown.rs

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ fn stats_table(stats: &ResponseStats) -> String {
5353
status: "\u{1f6ab} Errors",
5454
count: stats.errors,
5555
},
56+
StatsTableEntry {
57+
status: "\u{26d4} Unsupported",
58+
count: stats.unsupported,
59+
},
5660
];
5761
let style = Style::markdown();
5862

@@ -196,15 +200,16 @@ mod tests {
196200
fn test_render_stats() {
197201
let stats = ResponseStats::default();
198202
let table = stats_table(&stats);
199-
let expected = "| Status | Count |
200-
|---------------|-------|
201-
| 🔍 Total | 0 |
202-
| ✅ Successful | 0 |
203-
| ⏳ Timeouts | 0 |
204-
| 🔀 Redirected | 0 |
205-
| 👻 Excluded | 0 |
206-
| ❓ Unknown | 0 |
207-
| 🚫 Errors | 0 |";
203+
let expected = "| Status | Count |
204+
|----------------|-------|
205+
| 🔍 Total | 0 |
206+
| ✅ Successful | 0 |
207+
| ⏳ Timeouts | 0 |
208+
| 🔀 Redirected | 0 |
209+
| 👻 Excluded | 0 |
210+
| ❓ Unknown | 0 |
211+
| 🚫 Errors | 0 |
212+
| ⛔ Unsupported | 0 |";
208213
assert_eq!(table, expected.to_string());
209214
}
210215

@@ -228,15 +233,16 @@ mod tests {
228233
let summary = MarkdownResponseStats(stats);
229234
let expected = "# Summary
230235
231-
| Status | Count |
232-
|---------------|-------|
233-
| 🔍 Total | 1 |
234-
| ✅ Successful | 0 |
235-
| ⏳ Timeouts | 0 |
236-
| 🔀 Redirected | 0 |
237-
| 👻 Excluded | 0 |
238-
| ❓ Unknown | 0 |
239-
| 🚫 Errors | 1 |
236+
| Status | Count |
237+
|----------------|-------|
238+
| 🔍 Total | 1 |
239+
| ✅ Successful | 0 |
240+
| ⏳ Timeouts | 0 |
241+
| 🔀 Redirected | 0 |
242+
| 👻 Excluded | 0 |
243+
| ❓ Unknown | 0 |
244+
| 🚫 Errors | 1 |
245+
| ⛔ Unsupported | 0 |
240246
241247
## Errors per input
242248

0 commit comments

Comments
 (0)