Remove "total" columns in --show-coverage output

This commit is contained in:
Guillaume Gomez 2020-08-20 21:09:40 +02:00
parent 6fb7e02a36
commit 631c80659d
10 changed files with 54 additions and 64 deletions

View File

@ -48,7 +48,7 @@ impl ItemCount {
self.with_docs += 1;
}
if should_have_doc_examples {
self.total_examples += 1;
self.with_examples += 1;
if has_doc_example {
self.with_examples += 1;
}
@ -132,7 +132,7 @@ impl CoverageCalculator {
let mut total = ItemCount::default();
fn print_table_line() {
println!("+-{0:->35}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+", "");
println!("+-{0:->35}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+", "");
}
fn print_table_record(
@ -142,10 +142,9 @@ impl CoverageCalculator {
examples_percentage: f64,
) {
println!(
"| {:<35} | {:>10} | {:>10} | {:>9.1}% | {:>10} | {:>9.1}% |",
"| {:<35} | {:>10} | {:>9.1}% | {:>10} | {:>9.1}% |",
name,
count.with_docs,
count.total,
percentage,
count.with_examples,
examples_percentage,
@ -154,8 +153,8 @@ impl CoverageCalculator {
print_table_line();
println!(
"| {:<35} | {:>10} | {:>10} | {:>10} | {:>10} | {:>10} |",
"File", "Documented", "Total", "Percentage", "Examples", "Percentage",
"| {:<35} | {:>10} | {:>10} | {:>10} | {:>10} |",
"File", "Documented", "Percentage", "Examples", "Percentage",
);
print_table_line();

View File

@ -1,7 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/basic.rs | 7 | 14 | 50.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 7 | 14 | 50.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...tdoc-ui/coverage/doc-examples.rs | 4 | 4 | 100.0% | 2 | 50.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 4 | 4 | 100.0% | 2 | 50.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/empty.rs | 0 | 1 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 0 | 1 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 8 | 75.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 6 | 8 | 75.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,8 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 1 | 100.0% | 0 | 0.0% |
| <anon> | 2 | 2 | 100.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 3 | 3 | 100.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1 +1 @@
{"$DIR/json.rs":{"total":17,"with_docs":12,"total_examples":10,"with_examples":1}}
{"$DIR/json.rs":{"total":17,"with_docs":12,"total_examples":0,"with_examples":11}}

View File

@ -1,7 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...t/rustdoc-ui/coverage/private.rs | 4 | 7 | 57.1% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 4 | 7 | 57.1% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...oc-ui/coverage/statics-consts.rs | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,6 @@
+-------------------------------------+------------+------------+------------+------------+------------+
| File | Documented | Total | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+------------+
| ...st/rustdoc-ui/coverage/traits.rs | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
| Total | 6 | 7 | 85.7% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+