From e66a7a8a63aab6289bfc123e835020d71b2fbfeb Mon Sep 17 00:00:00 2001 From: Klaus Zerwes Date: Thu, 8 Sep 2022 15:15:24 +0200 Subject: [PATCH] fixed pyyaml list indent (pyyaml/issue #234) --- fqcn-fixer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fqcn-fixer.py b/fqcn-fixer.py index b1538c4..a66f737 100755 --- a/fqcn-fixer.py +++ b/fqcn-fixer.py @@ -35,6 +35,9 @@ def isexcluded(path, _exclude_paths): fnmatch.fnmatch(ppath, ep) for ep in _exclude_paths ) +class Dumper(yaml.Dumper): + def increase_indent(self, flow=False, *args, **kwargs): + return super().increase_indent(flow=flow, indentless=False) basepath = os.path.dirname(os.path.realpath(__file__)) @@ -173,6 +176,7 @@ if not fqcnmapfile or args.updatefqcnmapfile: fqcnmapfile.write( yaml.dump( fqcndict, + Dumper=Dumper, sort_keys=True, indent=2, width=70,