Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
Signed-off-by: gardar <gardar@users.noreply.github.com>
  • Loading branch information
gardar committed Jun 15, 2024
1 parent c4bd39a commit 06f003b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/antsibull_changelog/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
"""
Expand Down
4 changes: 2 additions & 2 deletions src/antsibull_changelog/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
"""
Expand All @@ -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,
)

0 comments on commit 06f003b

Please sign in to comment.