Skip to content

Commit

Permalink
fix: Increase indent of list items in yaml output
Browse files Browse the repository at this point in the history
Signed-off-by: gardar <[email protected]>
  • Loading branch information
gardar committed Apr 26, 2024
1 parent 9a75797 commit b21f35d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/antsibull_changelog/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@
import yaml

_SafeLoader: Any
_SafeDumper: Any
try:
# use C version if possible for speedup
from yaml import CSafeDumper as _SafeDumper
from yaml import CSafeLoader as _SafeLoader
except ImportError:
from yaml import SafeDumper as _SafeDumper
from yaml import SafeLoader as _SafeLoader


class _SafeDumper(yaml.SafeDumper):
"""
Extend YAML dumper to increase indent of list items.
"""
def increase_indent(self, flow=False, indentless=False):
return super().increase_indent(flow, False)


def load_yaml(path: str) -> Any:
"""
Load and parse YAML file ``path``.
Expand Down

0 comments on commit b21f35d

Please sign in to comment.