Skip to content

Commit d9bcb33

Browse files
authored
Merge pull request #93 from laserkelvin/ci-precommit-alignment
CI pre-commit alignment
2 parents 9a474a5 + bd49ef3 commit d9bcb33

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/run-precommit.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Run pre-commit hooks
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
- uses: actions/setup-python@v5
15+
name: Install Python 3.12
16+
with:
17+
python-version: "3.12"
18+
cache: 'pip'
19+
- run: pip install -U pip setuptools
20+
- uses: pre-commit/action@v3.0.1
21+
name: Configure and run pre-commit on changed files
22+
with:
23+
# the intention with this is to run pre-commit only
24+
# on the diff submitted with this PR
25+
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
26+
permissions: read-all

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929
rev: v3.10.1
3030
hooks:
3131
- id: pyupgrade
32-
args: [--py39-plus]
32+
args: [--py39-plus, --py310-plus, --py311-plus]
3333

3434
- repo: https://github.com/psf/black
3535
rev: 23.7.0
@@ -54,7 +54,7 @@ repos:
5454
]
5555
args:
5656
[
57-
"--extend-ignore=S105,E203",
57+
"--extend-ignore=S105,E203,W503,E701",
5858
"--per-file-ignores=__init__.py:F401",
5959
]
6060

0 commit comments

Comments
 (0)