From 06f003b0af3a6e4232d22ff86ad85954114e5ac5 Mon Sep 17 00:00:00 2001 From: gardar Date: Sat, 15 Jun 2024 04:00:26 +0000 Subject: [PATCH] fix: lint Signed-off-by: gardar --- src/antsibull_changelog/config.py | 13 +++++++++---- src/antsibull_changelog/yaml.py | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/antsibull_changelog/config.py b/src/antsibull_changelog/config.py index 5a75b72..6ed030e 100644 --- a/src/antsibull_changelog/config.py +++ b/src/antsibull_changelog/config.py @@ -475,7 +475,6 @@ def __init__( self.changelog_sort = self.config.get("changelog_sort", "alphanumerical") - self._validate_config(ignore_is_other_project) def _validate_config(self, ignore_is_other_project: bool) -> None: @@ -506,10 +505,16 @@ def _validate_config(self, ignore_is_other_project: bool) -> None: "combined with prevent_known_fragments == False" ) - valid_sort_options = ["unsorted", "version", "version_reverse", "alphanumerical"] + valid_sort_options = [ + "unsorted", + "version", + "version_reverse", + "alphanumerical", + ] if self.changelog_sort not in valid_sort_options: - raise ChangelogError(f"Invalid changelog_sort option: {self.changelog_sort}") - + raise ChangelogError( + f"Invalid changelog_sort option: {self.changelog_sort}" + ) def store(self) -> None: # noqa: C901 """ diff --git a/src/antsibull_changelog/yaml.py b/src/antsibull_changelog/yaml.py index a369a1b..70c8942 100644 --- a/src/antsibull_changelog/yaml.py +++ b/src/antsibull_changelog/yaml.py @@ -42,7 +42,7 @@ def load_yaml(path: str) -> Any: return yaml.load(stream, Loader=_SafeLoader) -def store_yaml(path: str, content: Any, nice: bool, sort_keys: bool = False) -> None: +def store_yaml(path: str, content: Any, nice: bool = False, sort_keys: bool = False) -> None: """ Store ``content`` as YAML file under ``path``. """ @@ -53,5 +53,5 @@ def store_yaml(path: str, content: Any, nice: bool, sort_keys: bool = False) -> default_flow_style=False, Dumper=_IndentedDumper if nice else _SafeDumper, explicit_start=nice, - sort_keys=sort_keys + sort_keys=sort_keys, )