Skip to content

Commit ca411d9

Browse files
committed
wikiman: fix pacman.yaml linting
Add additional indenting in pacman.yaml lists so that they will pass linting in the future. Note this commit does not include an updated pacman.yaml because this would also result in updating the specific commit hash named artefacts
1 parent a9ec9b0 commit ca411d9

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)