From 0efd76bc6a965586cc31d65239d8b44ef28b9878 Mon Sep 17 00:00:00 2001 From: Nicholas Wiltsie Date: Mon, 23 Sep 2024 15:51:28 -0700 Subject: [PATCH] Style files --- bumpchanges/bump.py | 2 +- bumpchanges/changelog.py | 11 +++-------- tests/conftest.py | 8 ++------ tests/test_bumpchanges.py | 4 ++-- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/bumpchanges/bump.py b/bumpchanges/bump.py index 609301d..f71c766 100644 --- a/bumpchanges/bump.py +++ b/bumpchanges/bump.py @@ -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) diff --git a/bumpchanges/changelog.py b/bumpchanges/changelog.py index 932293d..66adc13 100644 --- a/bumpchanges/changelog.py +++ b/bumpchanges/changelog.py @@ -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" @@ -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:] @@ -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()) diff --git a/tests/conftest.py b/tests/conftest.py index ee404c6..bd5e81e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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: @@ -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] diff --git a/tests/test_bumpchanges.py b/tests/test_bumpchanges.py index 5a35eab..358e20b 100644 --- a/tests/test_bumpchanges.py +++ b/tests/test_bumpchanges.py @@ -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