Skip to content

Commit eb8cda0

Browse files
[pre-commit.ci] pre-commit autoupdate (#45)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 22.8.0 → 22.10.0](psf/black@22.8.0...22.10.0) * Update pre-commit config * Update CHANGELOG * Fix linter/formatter warnings * Fix GitHub Action errors Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Damien Nguyen <ngn.damien@gmail.com>
1 parent 7b7aa21 commit eb8cda0

33 files changed

+216
-164
lines changed

.codespell.allow

Whitespace-only changes.

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
13
version: 2
24
updates:
35
- package-ecosystem: "github-actions"

.github/workflows/ci.yml

Lines changed: 43 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
13
name: CI
24

35
on:
@@ -16,69 +18,62 @@ jobs:
1618
matrix:
1719
runs-on: [ubuntu-latest, windows-latest, macos-latest]
1820
python:
19-
- 3.6
20-
- 3.7
21-
- 3.8
22-
- 3.9
21+
- 3.7
22+
- 3.8
23+
- 3.9
24+
- '3.10'
2325

2426
name: "🐍 ${{ matrix.python }} • ${{ matrix.runs-on }} • x64 ${{ matrix.args }}"
2527
runs-on: ${{ matrix.runs-on }}
26-
if: (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
28+
if: >-
29+
(github.event_name != 'pull_request'
30+
|| (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
2731
2832
steps:
29-
- uses: actions/checkout@v2
30-
31-
- name: Get history and tags for SCM versioning to work
32-
run: |
33-
git fetch --prune --unshallow
34-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
35-
36-
- name: Setup Python ${{ matrix.python }}
37-
uses: actions/setup-python@v2
38-
with:
39-
python-version: ${{ matrix.python }}
40-
architecture: 'x64'
33+
- uses: actions/checkout@v3
4134

42-
- name: Get pip cache dir
43-
id: pip-cache
44-
run: |
45-
echo "::set-output name=dir::$(python -m pip cache dir)"
35+
- name: Get history and tags for SCM versioning to work
36+
run: |
37+
git fetch --prune --unshallow
38+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
4639
47-
- name: Cache wheels
48-
uses: actions/cache@v2
49-
with:
50-
path: ${{ steps.pip-cache.outputs.dir }}
51-
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('setup.cfg', 'pyproject.toml') }}
40+
- name: Setup Python ${{ matrix.python }}
41+
uses: actions/setup-python@v3
42+
with:
43+
python-version: ${{ matrix.python }}
44+
architecture: 'x64'
45+
cache: 'pip'
46+
cache-dependency-path: '**/setup.cfg'
5247

53-
- name: Prepare env
54-
run: |
55-
python -m pip install -U wheel coveralls
48+
- name: Prepare env
49+
run: |
50+
python -m pip install -U wheel coveralls
5651
57-
- name: Setup annotations on Linux
58-
if: runner.os == 'Linux'
59-
run: python -m pip install pytest-github-actions-annotate-failures
52+
- name: Setup annotations on Linux
53+
if: runner.os == 'Linux'
54+
run: python -m pip install pytest-github-actions-annotate-failures
6055

61-
- name: Build and install package
62-
run: python -m pip install -e .[test]
56+
- name: Build and install package
57+
run: python -m pip install -e .[test]
6358

64-
- name: Run tests
65-
run: python -m pytest -v --cov=pylint_secure_coding_standard
59+
- name: Run tests
60+
run: python -m pytest -v --cov=pylint_secure_coding_standard
6661

67-
- name: Coveralls.io
68-
run: coveralls --service=github
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
COVERALLS_FLAG_NAME: python-${{ matrix.python }}-${{ matrix.runs-on }}-x64
72-
COVERALLS_PARALLEL: true
62+
- name: Coveralls.io
63+
run: coveralls --service=github
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
COVERALLS_FLAG_NAME: python-${{ matrix.python }}-${{ matrix.runs-on }}-x64
67+
COVERALLS_PARALLEL: true
7368

7469
finish:
7570
needs: standard
7671
runs-on: ubuntu-latest
7772
container: python:3-slim
7873
steps:
79-
- name: Coveralls Finished
80-
run: |
81-
pip3 install --upgrade coveralls
82-
coveralls --finish
83-
env:
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
- name: Coveralls Finished
75+
run: |
76+
pip3 install --upgrade coveralls
77+
coveralls --finish
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/codeql-analysis.yml

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12+
---
13+
1214
name: "CodeQL"
1315

1416
on:
1517
push:
16-
branches: [ main ]
18+
branches: [main]
1719
pull_request:
1820
# The branches below must be a subset of the branches above
19-
branches: [ main ]
21+
branches: [main]
2022
types: [assigned, opened, synchronize, reopened]
2123
schedule:
2224
- cron: '24 9 * * 0'
@@ -25,7 +27,9 @@ jobs:
2527
analyze:
2628
name: Analyze
2729
runs-on: ubuntu-latest
28-
if: (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
30+
if: >-
31+
(github.event_name != 'pull_request'
32+
|| (github.event_name == 'pull_request' && github.event.pull_request.merged != true))
2933
permissions:
3034
actions: read
3135
contents: read
@@ -34,24 +38,24 @@ jobs:
3438
strategy:
3539
fail-fast: false
3640
matrix:
37-
language: [ 'python' ]
41+
language: ['python']
3842

3943
steps:
40-
- name: Checkout repository
41-
uses: actions/checkout@v2
42-
43-
# Initializes the CodeQL tools for scanning.
44-
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v2
46-
with:
47-
languages: ${{ matrix.language }}
48-
# If you wish to specify custom queries, you can do so here or in a config file.
49-
# By default, queries listed here will override any specified in a config file.
50-
# Prefix the list here with "+" to use these queries and those in the config file.
51-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52-
53-
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v2
55-
56-
- name: Perform CodeQL Analysis
57-
uses: github/codeql-action/analyze@v2
44+
- name: Checkout repository
45+
uses: actions/checkout@v2
46+
47+
# Initializes the CodeQL tools for scanning.
48+
- name: Initialize CodeQL
49+
uses: github/codeql-action/init@v2
50+
with:
51+
languages: ${{ matrix.language }}
52+
# If you wish to specify custom queries, you can do so here or in a config file.
53+
# By default, queries listed here will override any specified in a config file.
54+
# Prefix the list here with "+" to use these queries and those in the config file.
55+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
56+
57+
- name: Autobuild
58+
uses: github/codeql-action/autobuild@v2
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@v2

.github/workflows/draft_release.yml

Lines changed: 40 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
13
name: "Draft new release"
24

35
on:
@@ -12,44 +14,45 @@ jobs:
1214
name: "Draft a new release"
1315
runs-on: ubuntu-latest
1416
steps:
15-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1618

17-
- name: Create release branch
18-
run: |
19-
git checkout -b release/${{ github.event.inputs.version }}
19+
- name: Create release branch
20+
run: |
21+
git checkout -b release/${{ github.event.inputs.version }}
2022
21-
- name: Update changelog
22-
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
23-
with:
24-
version: ${{ github.event.inputs.version }}
23+
- name: Update changelog
24+
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
25+
with:
26+
version: ${{ github.event.inputs.version }}
2527

26-
- name: Initialize mandatory git config
27-
run: |
28-
git config user.name "GitHub actions"
29-
git config user.email noreply@github.com
30-
- name: Commit changelog and manifest files
31-
id: make-commit
32-
run: |
33-
git add CHANGELOG.md
34-
git commit --message "Preparing release v${{ github.event.inputs.version }}"
35-
echo "::set-output name=commit::$(git rev-parse HEAD)"
36-
- name: Push new branch
37-
run: git push origin release/${{ github.event.inputs.version }}
28+
- name: Initialize mandatory git config
29+
run: |
30+
git config user.name "GitHub actions"
31+
git config user.email noreply@github.com
32+
- name: Commit changelog and manifest files
33+
id: make-commit
34+
run: |
35+
git add CHANGELOG.md
36+
git commit --message "Preparing release v${{ github.event.inputs.version }}"
37+
echo "::set-output name=commit::$(git rev-parse HEAD)"
38+
- name: Push new branch
39+
run: git push origin release/${{ github.event.inputs.version }}
3840

39-
- name: Create pull request
40-
uses: thomaseizinger/create-pull-request@1.2.2
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
with:
44-
head: release/${{ github.event.inputs.version }}
45-
base: main
46-
title: Release version ${{ github.event.inputs.version }}
47-
reviewers: ${{ github.actor }}
48-
# Write a nice message to the user.
49-
# We are claiming things here based on the `publish-new-release.yml` workflow.
50-
# You should obviously adopt it to say the truth depending on your release workflow :)
51-
body: |
52-
Hi @${{ github.actor }}!
53-
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
54-
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
55-
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.
41+
# yamllint disable rule:line-length
42+
- name: Create pull request
43+
uses: thomaseizinger/create-pull-request@1.2.2
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
head: release/${{ github.event.inputs.version }}
48+
base: main
49+
title: Release version ${{ github.event.inputs.version }}
50+
reviewers: ${{ github.actor }}
51+
# Write a nice message to the user.
52+
# We are claiming things here based on the `publish-new-release.yml` workflow.
53+
# You should obviously adopt it to say the truth depending on your release workflow :)
54+
body: |
55+
Hi @${{ github.actor }}!
56+
This PR was created in response to a manual trigger of the release workflow here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}.
57+
I've updated the changelog and bumped the versions in the manifest files in this commit: ${{ steps.make-commit.outputs.commit }}.
58+
Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.

.github/workflows/format.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
1+
---
2+
13
name: Format
24

35
on:
46
pull_request:
57
push:
68
branches:
7-
- main
8-
- "v*"
9+
- main
10+
- "v*"
911

1012
jobs:
1113
parse-changelog:
1214
name: Parse CHANGELOG
1315
runs-on: ubuntu-latest
14-
if: github.event_name == 'pull_request' && (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/'))
16+
if: >-
17+
github.event_name == 'pull_request'
18+
&& (startsWith(github.event.pull_request.head.ref, 'release/')
19+
|| startsWith(github.event.pull_request.head.ref, 'hotfix/'))
1520
steps:
16-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
1722
- name: Installing parse-changelog
1823
env:
1924
target: x86_64-unknown-linux-musl
20-
parse_changelog_tag: v0.4.5
25+
parse_changelog_tag: v0.5.1
26+
source_url: https://github.com/taiki-e/parse-changelog/releases/download
2127
run: |
22-
curl -LsSf "https://github.com/taiki-e/parse-changelog/releases/download/${parse_changelog_tag}/parse-changelog-${target}.tar.gz" | tar xzf -
28+
curl -LsSf "${source_url}/${parse_changelog_tag}/parse-changelog-${target}.tar.gz" | tar xzf -
2329
- name: Extract version from branch name (for release branches)
24-
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/')
30+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/')
2531
run: |
2632
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
2733
VERSION=${BRANCH_NAME#release/}

.github/workflows/publish_release.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
2+
13
name: "Publish new release"
24

35
on:
@@ -14,10 +16,14 @@ jobs:
1416
release:
1517
name: Build wheels and release on Pypi
1618
runs-on: ubuntu-latest
17-
if: startsWith(github.ref, 'refs/tags/') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && (startsWith(github.event.pull_request.head.ref, 'release/') || startsWith(github.event.pull_request.head.ref, 'hotfix/')))
19+
if: >-
20+
startsWith(github.ref, 'refs/tags/')
21+
|| (github.event_name == 'pull_request' && github.event.pull_request.merged == true
22+
&& (startsWith(github.event.pull_request.head.ref, 'release/')
23+
|| startsWith(github.event.pull_request.head.ref, 'hotfix/')))
1824
1925
steps:
20-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
2127

2228
- name: Get history and tags for SCM versioning to work
2329
run: |
@@ -32,7 +38,7 @@ jobs:
3238
echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV
3339
3440
- name: Extract version from branch name (for release branches)
35-
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/')
41+
if: github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'release/')
3642
run: |
3743
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
3844
VERSION=${BRANCH_NAME#release/}
@@ -75,21 +81,25 @@ jobs:
7581
- name: Create release
7682
env:
7783
target: x86_64-unknown-linux-musl
78-
parse_changelog_tag: v0.4.7
84+
source_url: https://github.com/taiki-e/parse-changelog/releases/download
85+
parse_changelog_tag: v0.5.1
7986
changelog: CHANGELOG.md
8087
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8188
run: |
8289
# https://github.com/taiki-e/parse-changelog
83-
curl -LsSf "https://github.com/taiki-e/parse-changelog/releases/download/${parse_changelog_tag}/parse-changelog-${target}.tar.gz" | tar xzf -
90+
curl -LsSf "${source_url}/${parse_changelog_tag}/parse-changelog-${target}.tar.gz" | tar xzf -
8491
notes=$(./parse-changelog "${changelog}" "${RELEASE_VERSION}")
8592
rm -f ./parse-changelog
8693
if [[ "${tag}" =~ ^v?[0-9\.]+-[a-zA-Z_0-9\.-]+(\+[a-zA-Z_0-9\.-]+)?$ ]]; then
8794
prerelease="--prerelease"
8895
fi
89-
gh release create "v${RELEASE_VERSION}" ${prerelease:-} --title "pylint-secure-coding-standard v${RELEASE_VERSION}" --notes "${notes:-}" dist/*
96+
gh release create "v${RELEASE_VERSION}" ${prerelease:-} \
97+
--title pylint-secure-coding-standard v${RELEASE_VERSION}" \
98+
--notes "${notes:-}" \
99+
dist/*
90100
91101
- name: Setup Python for Pypi upload
92-
uses: actions/setup-python@v2
102+
uses: actions/setup-python@v3
93103

94104
- name: Publish standard package
95105
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)