Skip to content

Commit

Permalink
fixup! Auto-redact dirty reason like `1719325877.527949100s, 61549498…
Browse files Browse the repository at this point in the history
…ns after last build at 1719325877.466399602s`
  • Loading branch information
choznerol committed Jul 1, 2024
1 parent 3480fe5 commit 75f6f5f
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions crates/cargo-test-support/src/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,20 +206,10 @@ fn add_common_redactions(subs: &mut snapbox::Redactions) {
// "1719503592.218193216s, 1h 1s after last build at 1719499991.982681034s"
// into "[DIRTY_REASON_NEW_TIME], [DIRTY_REASON_DIFF] after last build at [DIRTY_REASON_OLD_TIME]"
subs.insert(
"[DIRTY_REASON_NEW_TIME]",
regex!(r"(?<redacted>[0-9]+(\.[0-9]+)?s), (\s?[0-9]+(\.[0-9]+)?(s|ns|h))+ after last build at ([0-9]+(\.[0-9]+)?s)"),
"[TIME_DIFF_AFTER_LAST_BUILD]",
regex!(r"(?<redacted>[0-9]+(\.[0-9]+)?s, (\s?[0-9]+(\.[0-9]+)?(s|ns|h))+ after last build at [0-9]+(\.[0-9]+)?s)"),
)
.unwrap();
subs.insert(
"[DIRTY_REASON_DIFF]",
regex!(r"\[\w+\], (?<redacted>(\s?[0-9]+(\.[0-9]+)?(s|ns|h))+) after last build at ([0-9]+(\.[0-9]+)?s)"),
)
.unwrap();
subs.insert(
"[DIRTY_REASON_OLD_TIME]",
regex!(r"\[\w+\], \[\w+\] after last build at (?<redacted>[0-9]+(\.[0-9]+)?s)"),
)
.unwrap();
}

static MIN_LITERAL_REDACTIONS: &[(&str, &str)] = &[
Expand Down

0 comments on commit 75f6f5f

Please sign in to comment.