Skip to content

Commit 5b91c0e

Browse files
authored
Merge pull request #322 from wbstack/fix-pacman-linting
wikiman: fix pacman.yaml liting
2 parents a9ec9b0 + ca411d9 commit 5b91c0e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

sync/wikiman/wikiman.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def make_artifact_entry(details: Dict[str, str], extra_remove: List[str]) -> Dic
5454
}
5555
return entry
5656

57+
# pylint: disable=too-many-ancestors
58+
class FixedIndentingDumper(yaml.Dumper):
59+
"""Fix for making yaml list output pass linting https://stackoverflow.com/a/39681672"""
60+
def increase_indent(self, flow=False, indentless=False):
61+
return super().increase_indent(flow, False)
62+
5763
default_branch = get_mediawiki_branch_from_version(mediawiki_version)
5864
remove_from_all = codebases.get('removeFromAll', [])
5965
output: List[Dict] = [make_artifact_entry({
@@ -76,4 +82,4 @@ def make_artifact_entry(details: Dict[str, str], extra_remove: List[str]) -> Dic
7682

7783
# write out to the lock.yaml file
7884
with open(DESTINATION_YAMLFILE, 'w') as outfile:
79-
yaml.dump(output, outfile, sort_keys=False)
85+
yaml.dump(output, outfile, sort_keys=False, Dumper=FixedIndentingDumper, default_flow_style=False)

0 commit comments

Comments
 (0)