Skip to content

Commit d6b8e2c

Browse files
committed
chore(lint): apply linter fixes
1 parent 59e0096 commit d6b8e2c

File tree

9 files changed

+25
-24
lines changed

9 files changed

+25
-24
lines changed

.github/workflows/release.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
---
12
name: "Release Workflow"
23

3-
on:
4+
"on":
45
push:
56
tags:
67
- '[0-9]+.[0-9]+.[0-9]+'

.github/workflows/validate_pr.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
---
12
name: "Validate Pull Request"
23

3-
on:
4+
"on":
45
pull_request:
56

67
concurrency:
7-
group: ${{ github.workflow }}-${{ github.head_ref }}
8-
cancel-in-progress: true
8+
group: ${{ github.workflow }}-${{ github.head_ref }}
9+
cancel-in-progress: true
910

1011
jobs:
1112
github-actions-validator:

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
- id: check-useless-excludes
2828

2929
- repo: https://github.com/frnmst/md-toc
30-
rev: master
30+
rev: 9.0.0
3131
hooks:
3232
- id: md-toc
3333

@@ -36,13 +36,13 @@ repos:
3636
- id: black
3737
name: black
3838
language: system
39-
entry: venv/bin/black --check
39+
entry: venv/bin/black
4040
types: ["python"]
4141

4242
- id: isort
4343
name: isort
4444
language: system
45-
entry: venv/bin/isort --check-only --diff --recursive
45+
entry: venv/bin/isort --recursive
4646
types: ["python"]
4747

4848
- id: pylint
@@ -59,7 +59,7 @@ repos:
5959
types: ["yaml"]
6060

6161
- repo: https://github.com/lumapps/commit-message-validator
62-
rev: master
62+
rev: 1.5.1
6363
hooks:
6464
- id: commit-message-validator
6565
stages: [commit-msg]

.pylintrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[MESSAGES CONTROL]
2-
disable=bad-continuation, # Delegate format to black
3-
duplicate-bases, # typing.Generic can be used multiple time as base (see. https://github.com/PyCQA/pylint/issues/2717)
2+
disable=duplicate-bases, # typing.Generic can be used multiple time as base (see. https://github.com/PyCQA/pylint/issues/2717)
43
duplicate-code, # The entry-points are exepcted to be very similar
54
isinstance-second-argument-not-valid-type, # Incompatible with type hints
65
too-many-ancestors, # Incompatible with type hints

action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ inputs:
1111
github_token:
1212
description: |
1313
The github token to be used to fetch the repository
14-
14+
1515
Notes:
1616
this will become required in the next version
1717
tag_prefix:
1818
description: if you tags follow the `prefix/version` pattern
1919
required: false
2020
path_filters:
2121
description: |
22-
A space separated list of git path blob regex to be used to filters the commits.
22+
A space separated list of git path blob regex to be used to filters the commits.
2323
This can be used to keep only relevant commits by filtering on relevant files.
2424
Example:
2525
path_filters: "src/ doc/ tests/*/qa/*"
@@ -41,26 +41,26 @@ runs:
4141
run: |
4242
# install de dependencies
4343
pip3 install -r ${{ github.action_path }}/requirements.txt
44-
44+
4545
# define the environment variables
4646
export PYTHONPATH=${{ github.action_path }}:$PYTHONPATH
47-
47+
4848
# for retro-compatibility purpose. once github_token is required, then no need for the if
4949
if test ! -z "${{ inputs.github_token }}"
5050
then
5151
export GITHUB_TOKEN=${{ inputs.github_token }}
5252
fi
53-
53+
5454
# generate the change log
5555
CHANGELOG=$(python3 -m changelog_generator \
5656
--tag_prefix ${{ inputs.tag_prefix }} \
5757
--path_filters ${{ inputs.path_filters }} \
5858
--target ${{ inputs.target }}
5959
)
60-
60+
6161
# truncate the release note to not bloat the 65536 bytes max limit
6262
CHANGELOG=${CHANGELOG:0:65200}
63-
63+
6464
# output the changelog
6565
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
6666
echo "$CHANGELOG" >> $GITHUB_ENV

changelog_generator/commit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ def get_revert_data(self) -> None:
5252
summary_res = re_header_pattern.match(res.group("summary"))
5353
if summary_res:
5454
self.scope = summary_res.group("scope")
55-
self.subject = "revert %s" % summary_res.group("subject")
55+
self.subject = f"revert {summary_res.group('subject')}"
5656
else:
5757
self.scope = "any"
58-
self.subject = "revert %s" % res.group("summary")
58+
self.subject = f"revert {res.group('summary')}"
5959

6060
def get_jira_data(self) -> None:
6161
self.jiras = []

changelog_generator/tag_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class BaseTagManager(ABC):
1010

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

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

7272

7373
class PrefixedTagManager(BaseTagManager):

rewrite_existing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""
2-
Uses the gh cli to easily rewrite a existing release note
2+
Uses the GitHub command line tool to easily rewrite a existing release note
33
44
How To Use:
55
python -m path_to_repository previousTag..nextTag [filter_path1 filter_path2]
66
77
"""
8+
89
import subprocess
910
from argparse import ArgumentParser
1011

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from setuptools import setup, find_namespace_packages
2-
1+
from setuptools import find_namespace_packages, setup
32

43
setup(
54
name="changelog-generator",

0 commit comments

Comments
 (0)