Skip to content

Commit

Permalink
Filter versions in lint reference links in snapshots (#913)
Browse files Browse the repository at this point in the history
filter versions in lint references
  • Loading branch information
suaviloquence authored Sep 3, 2024
1 parent 6092892 commit 7b7a518
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/snapshot_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ fn assert_integration_test(test_name: &str, invocation: &[&str]) {
// Remove cargo blocking lines (e.g. from `cargo doc` output) as the amount of blocks
// is not reproducible.
settings.add_filter(" Blocking waiting for file lock on package cache\n", "");
// Filter out the current `cargo-semver-checks` version in links to lint references,
// as this will break across version changes.
settings.add_filter(
r"v\d+\.\d+\.\d+(-[\w\.-]+)?/src/lints",
"[VERSION]/src/lints",
);

// The `settings` are applied to the current thread as long as the returned
// drop guard `_grd` is alive, so we use a `let` binding to keep it alive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aborting due to failure to build rustdoc for crate error v0.1.0
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.35.0/src/lints/function_missing.ron
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/[VERSION]/src/lints/function_missing.ron

Failed in:
function no_error::my_fn, previously in file [ROOT]/test_crates/manifest_tests/workspace_baseline_compile_error/old/no-error/src/lib.rs:3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ success: false
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.35.0/src/lints/function_missing.ron
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/[VERSION]/src/lints/function_missing.ron

Failed in:
function a::should_not_run, previously in file [ROOT]/test_crates/manifest_tests/workspace_all_publish_false/old/a/src/lib.rs:4
Expand Down

0 comments on commit 7b7a518

Please # to comment.