Skip to content

Commit

Permalink
Fixing bad-format edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonlhart committed Mar 1, 2023
1 parent 4a5d2be commit dd4645a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/sanity_ignores/tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
plugins/module_utils/ansible_example_module.py import-3.6!skip
plugins/module_utils/ansible_example_module.py import-3.6!skip # comment
2 changes: 2 additions & 0 deletions src/ansiblelint/rules/sanity_ignore_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ def matchyaml(self, file: Lintable) -> list[MatchError]:
for line_num, entry in enumerate(entries, 1):
if entry and entry[0] != "#":
try:
if "#" in entry:
entry, _ = entry.split("#")
(_, test) = entry.split()
if test not in self.allowed_ignores:
results.append(
Expand Down

0 comments on commit dd4645a

Please sign in to comment.