Skip to content

Commit 8813d09

Browse files
committed
[TEST] print table
1 parent 37ec89f commit 8813d09

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lintcheck/src/json.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,39 @@ pub(crate) fn diff(old_path: &Path, new_path: &Path, truncate: bool) {
6262

6363
let mut lint_warnings = vec![];
6464

65+
println!("| Lint | Added | Removed | Changed | Unchainged |");
66+
println!("| ------------------------------------------ | ------: | ------: | ------: | ---------: |");
67+
6568
for (name, changes) in &itertools::merge_join_by(old_warnings, new_warnings, |old, new| old.key().cmp(&new.key()))
6669
.chunk_by(|change| change.as_ref().into_left().lint.to_string())
6770
{
6871
let mut added = Vec::new();
6972
let mut removed = Vec::new();
7073
let mut changed = Vec::new();
74+
let mut unchanged = 0;
7175
for change in changes {
7276
match change {
7377
EitherOrBoth::Both(old, new) => {
7478
if old.rendered != new.rendered {
7579
changed.push((old, new));
80+
} else {
81+
unchanged += 1;
7682
}
7783
},
7884
EitherOrBoth::Left(old) => removed.push(old),
7985
EitherOrBoth::Right(new) => added.push(new),
8086
}
8187
}
8288

89+
println!(
90+
"| {:<62} | {:>7} | {:>7} | {:>7} | {:>10} |",
91+
format!("`{}`", name),
92+
added.len(),
93+
removed.len(),
94+
changed.len(),
95+
unchanged,
96+
);
97+
8398
if !added.is_empty() || !removed.is_empty() || !changed.is_empty() {
8499
lint_warnings.push(LintWarnings {
85100
name,
@@ -90,6 +105,8 @@ pub(crate) fn diff(old_path: &Path, new_path: &Path, truncate: bool) {
90105
}
91106
}
92107

108+
println!();
109+
println!();
93110
print_summary_table(&lint_warnings);
94111
println!();
95112

lintcheck/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Crate {
139139
//
140140
// It also makes sense to include tests either way, since some Clippy lints
141141
// have custom behavior in test code.
142-
cmd.arg("--tests");
142+
// cmd.arg("--tests");
143143

144144
cmd.arg("--quiet")
145145
.current_dir(&self.path)

0 commit comments

Comments
 (0)