File tree Expand file tree Collapse file tree 2 files changed +48
-2
lines changed
src/repo_review/resources Expand file tree Collapse file tree 2 files changed +48
-2
lines changed Original file line number Diff line number Diff line change 9
9
"$ref" : " #/$defs/checks"
10
10
},
11
11
"ignore" : {
12
- "$ref" : " #/$defs/checks"
12
+ "oneOf" : [
13
+ {
14
+ "$ref" : " #/$defs/checks"
15
+ },
16
+ {
17
+ "type" : " object" ,
18
+ "patternProperties" : {
19
+ "^[A-Z]+[0-9]*$" : { "type" : " string" }
20
+ },
21
+ "additionalProperties" : false
22
+ }
23
+ ]
13
24
}
14
25
},
15
26
"$defs" : {
Original file line number Diff line number Diff line change @@ -43,10 +43,45 @@ def test_broken_validate_pyproject(tmp_path: Path) -> None:
43
43
results = process (tmp_path )
44
44
45
45
(result ,) = (r for r in results .results if r .name == "VPP001" )
46
- assert "must match pattern " in result .err_msg
46
+ assert "must be valid exactly by one definition " in result .err_msg
47
47
assert not result .result
48
48
49
49
50
+ def test_broken_validate_pyproject_object (tmp_path : Path ) -> None :
51
+ pytest .importorskip ("validate_pyproject" )
52
+ tmp_path .joinpath ("pyproject.toml" ).write_text (
53
+ textwrap .dedent (
54
+ """\
55
+ [tool.repo-review.ignore]
56
+ a2 = "some message"
57
+ """
58
+ )
59
+ )
60
+
61
+ results = process (tmp_path )
62
+
63
+ (result ,) = (r for r in results .results if r .name == "VPP001" )
64
+ assert "must be valid exactly by one definition" in result .err_msg
65
+ assert not result .result
66
+
67
+
68
+ def test_working_validate_pyproject_object (tmp_path : Path ) -> None :
69
+ pytest .importorskip ("validate_pyproject" )
70
+ tmp_path .joinpath ("pyproject.toml" ).write_text (
71
+ textwrap .dedent (
72
+ """\
73
+ [tool.repo-review.ignore]
74
+ PP102 = "some message"
75
+ """
76
+ )
77
+ )
78
+
79
+ results = process (tmp_path )
80
+
81
+ (result ,) = (r for r in results .results if r .name == "VPP001" )
82
+ assert result .result
83
+
84
+
50
85
def test_testing_function ():
51
86
pytest .importorskip ("sp_repo_review" )
52
87
You can’t perform that action at this time.
0 commit comments