Skip to content

Commit

Permalink
Style files
Browse files Browse the repository at this point in the history
  • Loading branch information
nwiltsie committed Sep 23, 2024
1 parent 0403b04 commit 0efd76b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bumpchanges/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def update_changelog(
changelog_file: Path, repo_url: str, version: str, date: datetime.date
):
"Rewrite a CHANGELOG file for a new release."
"""Rewrite a CHANGELOG file for a new release."""

try:
changelog = Changelog(changelog_file, repo_url)
Expand Down
11 changes: 3 additions & 8 deletions bumpchanges/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ class Version:
wrong_h1_re: ClassVar = re.compile(r"^\[v?\d")

# Regex to match H2 category-like headers taht should be H3s
wrong_h2_re: ClassVar = re.compile(
r"Add|Fix|Change|Remove",
flags=re.IGNORECASE
)
wrong_h2_re: ClassVar = re.compile(r"Add|Fix|Change|Remove", flags=re.IGNORECASE)

UNRELEASED_VERSION: ClassVar = "Unreleased"

Expand Down Expand Up @@ -184,8 +181,7 @@ def from_tokens(cls, tokens):
# a digit
if cls.leading_v_re.match(kwargs["version"]):
logging.getLogger(__name__).warning(
"Stripping leading `v` from Changelog version `%s`",
kwargs["version"]
"Stripping leading `v` from Changelog version `%s`", kwargs["version"]
)
kwargs["version"] = kwargs["version"][1:]

Expand Down Expand Up @@ -371,8 +367,7 @@ def update_version(self, next_version: str, date: datetime.date):
"""Move all unreleased changes under the new version."""
if not self.versions or self.versions[0].version != Version.UNRELEASED_VERSION:
logging.getLogger(__name__).warning(
"No %s section - adding a new empty section",
Version.UNRELEASED_VERSION
"No %s section - adding a new empty section", Version.UNRELEASED_VERSION
)
self.versions.insert(0, Version.blank_unreleased())

Expand Down
8 changes: 2 additions & 6 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@


def pytest_configure(config: pytest.Config) -> None:
"""
Configure plugin by loading the Changelog data.
"""
"""Configure plugin by loading the Changelog data."""
resource_path = Path(__file__).resolve().parent.joinpath("resources")
changelogs_file = resource_path / "changelogs.json"
with changelogs_file.open(mode="r", encoding="utf-8") as infile:
Expand Down Expand Up @@ -55,9 +53,7 @@ def pytest_configure(config: pytest.Config) -> None:


def pytest_generate_tests(metafunc: pytest.Metafunc):
"""
Inject parameters for the 'changelog_update' fixture.
"""
"""Inject parameters for the 'changelog_update' fixture."""
if "changelog_update" in metafunc.fixturenames:
metafunc.parametrize(
"changelog_update", metafunc.config.stash[changelog_updates_key]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bumpchanges.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"Tests for the bumpchanges module."
"""Tests for the bumpchanges module."""


def test_something():
"An empty test. Should be filled with something."
"""An empty test. Should be filled with something."""
assert True

0 comments on commit 0efd76b

Please sign in to comment.