Skip to content

Commit 95d8895

Browse files
authored
Fix ignore file generation (#3046)
1 parent 3d07f99 commit 95d8895

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/ansiblelint/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,12 @@ def report_outcome(self, result: LintResult, mark_as_success: bool = False) -> i
171171
console_stderr.print(f"Writing ignore file to {IGNORE_TXT}")
172172
lines = set()
173173
for rule in result.matches:
174-
lines.add(f"{rule.filename} {rule.tag}")
174+
lines.add(f"{rule.filename} {rule.tag}\n")
175175
with open(IGNORE_TXT, "w", encoding="utf-8") as ignore_file:
176176
ignore_file.write(
177177
"# This file contains ignores rule violations for ansible-lint\n"
178178
)
179179
ignore_file.writelines(sorted(list(lines)))
180-
ignore_file.write("\n")
181180
elif matched_rules and not self.options.quiet:
182181
console_stderr.print(
183182
"Read [link=https://ansible-lint.readthedocs.io/configuring/#ignoring-rules-for-entire-files]documentation[/link] for instructions on how to ignore specific rule violations."

0 commit comments

Comments
 (0)