Skip to content

chore(lint): apply linter fixes #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: "Release Workflow"

on:
"on":
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/validate_pr.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
---
name: "Validate Pull Request"

on:
"on":
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

jobs:
github-actions-validator:
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/frnmst/md-toc
rev: master
rev: 9.0.0
hooks:
- id: md-toc

Expand All @@ -36,13 +36,13 @@ repos:
- id: black
name: black
language: system
entry: venv/bin/black --check
entry: venv/bin/black
types: ["python"]

- id: isort
name: isort
language: system
entry: venv/bin/isort --check-only --diff --recursive
entry: venv/bin/isort --recursive
types: ["python"]

- id: pylint
Expand All @@ -59,7 +59,7 @@ repos:
types: ["yaml"]

- repo: https://github.com/lumapps/commit-message-validator
rev: master
rev: 1.5.1
hooks:
- id: commit-message-validator
stages: [commit-msg]
Expand Down
3 changes: 1 addition & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[MESSAGES CONTROL]
disable=bad-continuation, # Delegate format to black
duplicate-bases, # typing.Generic can be used multiple time as base (see. https://github.com/PyCQA/pylint/issues/2717)
disable=duplicate-bases, # typing.Generic can be used multiple time as base (see. https://github.com/PyCQA/pylint/issues/2717)
duplicate-code, # The entry-points are exepcted to be very similar
isinstance-second-argument-not-valid-type, # Incompatible with type hints
too-many-ancestors, # Incompatible with type hints
Expand Down
14 changes: 7 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ inputs:
github_token:
description: |
The github token to be used to fetch the repository

Notes:
this will become required in the next version
tag_prefix:
description: if you tags follow the `prefix/version` pattern
required: false
path_filters:
description: |
A space separated list of git path blob regex to be used to filters the commits.
A space separated list of git path blob regex to be used to filters the commits.
This can be used to keep only relevant commits by filtering on relevant files.
Example:
path_filters: "src/ doc/ tests/*/qa/*"
Expand All @@ -41,26 +41,26 @@ runs:
run: |
# install de dependencies
pip3 install -r ${{ github.action_path }}/requirements.txt

# define the environment variables
export PYTHONPATH=${{ github.action_path }}:$PYTHONPATH

# for retro-compatibility purpose. once github_token is required, then no need for the if
if test ! -z "${{ inputs.github_token }}"
then
export GITHUB_TOKEN=${{ inputs.github_token }}
fi

# generate the change log
CHANGELOG=$(python3 -m changelog_generator \
--tag_prefix ${{ inputs.tag_prefix }} \
--path_filters ${{ inputs.path_filters }} \
--target ${{ inputs.target }}
)

# truncate the release note to not bloat the 65536 bytes max limit
CHANGELOG=${CHANGELOG:0:65200}

# output the changelog
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions changelog_generator/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ def get_revert_data(self) -> None:
summary_res = re_header_pattern.match(res.group("summary"))
if summary_res:
self.scope = summary_res.group("scope")
self.subject = "revert %s" % summary_res.group("subject")
self.subject = f"revert {summary_res.group('subject')}"
else:
self.scope = "any"
self.subject = "revert %s" % res.group("summary")
self.subject = f"revert {res.group('summary')}"

def get_jira_data(self) -> None:
self.jiras = []
Expand Down
4 changes: 2 additions & 2 deletions changelog_generator/tag_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BaseTagManager(ABC):

def get_semver_from_tag(self, tag: str) -> Tuple[int, ...]:
"""
Splits a tag in a semver tuple of ints (major,minor,bug,rc).
Splits a tag in a semantic versioning tuple of integers (major,minor,bug,patch).
"""
res = self.PATTERN.match(tag)
if not res:
Expand Down Expand Up @@ -67,7 +67,7 @@ def is_release_tag(self, tag: str) -> bool:
return res and not res.group("rc")

def get_tags(self):
return self.repository.git.tag(f"--merged").split("\n")
return self.repository.git.tag("--merged").split("\n")


class PrefixedTagManager(BaseTagManager):
Expand Down
3 changes: 2 additions & 1 deletion rewrite_existing.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""
Uses the gh cli to easily rewrite a existing release note
Uses the GitHub command line tool to easily rewrite a existing release note

How To Use:
python -m path_to_repository previousTag..nextTag [filter_path1 filter_path2]

"""

import subprocess
from argparse import ArgumentParser

Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from setuptools import setup, find_namespace_packages

from setuptools import find_namespace_packages, setup

setup(
name="changelog-generator",
Expand Down
Loading