Skip to content

Commit

Permalink
Merge pull request #93 from laserkelvin/ci-precommit-alignment
Browse files Browse the repository at this point in the history
CI pre-commit alignment
  • Loading branch information
Pennycook authored Apr 3, 2024
2 parents 9a474a5 + bd49ef3 commit d9bcb33
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/run-precommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run pre-commit hooks

on:
pull_request:
branches: [ "main" ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-python@v5
name: Install Python 3.12
with:
python-version: "3.12"
cache: 'pip'
- run: pip install -U pip setuptools
- uses: pre-commit/action@v3.0.1
name: Configure and run pre-commit on changed files
with:
# the intention with this is to run pre-commit only
# on the diff submitted with this PR
extra_args: --color=always --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}
permissions: read-all
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py39-plus, --py310-plus, --py311-plus]

- repo: https://github.com/psf/black
rev: 23.7.0
Expand All @@ -54,7 +54,7 @@ repos:
]
args:
[
"--extend-ignore=S105,E203",
"--extend-ignore=S105,E203,W503,E701",
"--per-file-ignores=__init__.py:F401",
]

Expand Down

0 comments on commit d9bcb33

Please sign in to comment.