Skip to content

Commit

Permalink
Run code through ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
nwiltsie committed Aug 2, 2024
1 parent 7bd3032 commit 644ce8e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions bumpchanges/bump.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
from .logging import setup_logging


def update_changelog(changelog_file: Path, repo_url: str, version: str, date: datetime.date):
def update_changelog(
changelog_file: Path, repo_url: str, version: str, date: datetime.date
):
"Rewrite a CHANGELOG file for a new release."

try:
Expand Down Expand Up @@ -56,14 +58,16 @@ def write_commit_details(version: str):
with tempfile.NamedTemporaryFile(
mode="w", encoding="utf-8", dir=os.environ["GITHUB_WORKSPACE"], delete=False
) as bodyfile:
bodyfile.write(f"""\
bodyfile.write(
f"""\
Update CHANGELOG in preparation for release **{version}**.
Merging this PR will trigger another workflow to create the release tag **v{version}**.
| Input | Value |
| ----- | ----- |
""")
"""
)

for key, value in body_values.items():
bodyfile.write(f"| {key} | {value} |\n")
Expand Down
1 change: 0 additions & 1 deletion bumpchanges/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ def update_version(self, next_version: str, date: datetime.date):
self.versions[0].version = next_version
self.versions[0].date = date.isoformat()


def render(self) -> str:
"Render the CHANGELOG to markdown."
renderer = mdformat.renderer.MDRenderer()
Expand Down
4 changes: 3 additions & 1 deletion bumpchanges/getversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ def get_next_version(repo_dir: Path, bump_type: str, exact_version: str) -> str:
raise RuntimeError()

if re.match(r"^v\d", exact_version):
logger.error("Input version `{exact_version}` should not have a leading `v`")
logger.error(
"Input version `{exact_version}` should not have a leading `v`"
)
raise RuntimeError()

next_version = exact_version
Expand Down
1 change: 1 addition & 0 deletions bumpchanges/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def notice(self, msg, *args, **kwargs):

class GHAFilter(logging.Filter):
"A logging filter that plays nice with GitHub Actions output."

# pylint: disable=too-few-public-methods

prefixes = {
Expand Down

0 comments on commit 644ce8e

Please sign in to comment.