Skip to content

Commit 54da7c0

Browse files
committed
Add witness hint for module_missing lint and update snapshot
1 parent 09ecf4f commit 54da7c0

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/lints/module_missing.ron

+3
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ SemverQuery(
4747
},
4848
error_message: "A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.",
4949
per_result_error_template: Some("mod {{join \"::\" path}}, previously in file {{span_filename}}:{{span_begin_line}}"),
50+
witness: (
51+
hint_template: r#"use {{join "::" path}};"#,
52+
),
5053
)
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
source: src/query.rs
3+
description: "Lint `module_missing` did not have the expected witness output.\nSee https://github.com/obi1kenobi/cargo-semver-checks/blob/main/CONTRIBUTING.md#testing-witnesses\nfor more information."
4+
expression: "&actual_witnesses"
5+
---
6+
[["./test_crates/module_missing/"]]
7+
filename = 'src/lib.rs'
8+
begin_line = 10
9+
hint = 'use module_missing::bb::will_remove;'
10+
11+
[["./test_crates/module_missing/"]]
12+
filename = 'src/lib.rs'
13+
begin_line = 13
14+
hint = 'use module_missing::will_make_private;'
15+
16+
[["./test_crates/trait_missing/"]]
17+
filename = 'src/lib.rs'
18+
begin_line = 7
19+
hint = 'use trait_missing::my_pub_mod;'
20+
21+
[["./test_crates/trait_missing_with_major_bump/"]]
22+
filename = 'src/lib.rs'
23+
begin_line = 7
24+
hint = 'use trait_missing_with_major_bump::my_pub_mod;'

0 commit comments

Comments
 (0)