-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false negatives for exclamation and question mark in yml/plain-sc…
…alar rule
- Loading branch information
Showing
11 changed files
with
185 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
tests/fixtures/rules/plain-scalar/invalid/exclamation-test-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[ | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 2, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 2, | ||
"column": 8 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 3, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 3, | ||
"column": 9 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 4, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 4, | ||
"column": 10 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 5, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 5, | ||
"column": 10 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 6, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 6, | ||
"column": 11 | ||
} | ||
] |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/rules/plain-scalar/invalid/exclamation-test-input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# {} | ||
"a!a": "b !b" | ||
"a!!a": "b !!b" | ||
"a!! a": "b !! b" | ||
"a!<a>": "b !<b>" | ||
"a! <a>": "b ! <b>" |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/rules/plain-scalar/invalid/exclamation-test-output.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# plain-scalar/invalid/exclamation-test-input.yml | ||
a!a: b !b | ||
a!!a: b !!b | ||
a!! a: b !! b | ||
a!<a>: b !<b> | ||
a! <a>: b ! <b> |
22 changes: 22 additions & 0 deletions
22
tests/fixtures/rules/plain-scalar/invalid/question-test-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[ | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 2, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 4, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 5, | ||
"column": 1 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 6, | ||
"column": 1 | ||
} | ||
] |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/rules/plain-scalar/invalid/question-test-input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# {} | ||
"?a": b | ||
"? a": b | ||
"?? a": b | ||
"a?a": b | ||
"a ? a": b |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/rules/plain-scalar/invalid/question-test-output.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# plain-scalar/invalid/question-test-input.yml | ||
?a: b | ||
"? a": b | ||
?? a: b | ||
a?a: b | ||
a ? a: b |
42 changes: 42 additions & 0 deletions
42
tests/fixtures/rules/plain-scalar/invalid/test-errors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
[ | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 3, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 3, | ||
"column": 12 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 3, | ||
"column": 22 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 3, | ||
"column": 33 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 4, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 4, | ||
"column": 19 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 5, | ||
"column": 3 | ||
}, | ||
{ | ||
"message": "Must use plain style scalar.", | ||
"line": 5, | ||
"column": 18 | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# {} | ||
{ | ||
"hello": "Hello!", "goodbye": "Goodbye!", | ||
"good-morning": "Good Morning", | ||
"how-are-you": "How are you doing?" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# plain-scalar/invalid/test-input.yaml | ||
{ | ||
hello: Hello!, goodbye: Goodbye!, | ||
good-morning: Good Morning, | ||
how-are-you: How are you doing? | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/rules/plain-scalar/valid/exclamation-test-input.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# {} | ||
"!a": "!b" | ||
"!!a": "!!b" | ||
"!! a": "!! b" | ||
"!<a>": "!<b>" | ||
"! <a>": "! <b>" |