Skip to content

Commit ccf1101

Browse files
committed
Run pre-commit checks in CI
1 parent c51735e commit ccf1101

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

.github/workflows/check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Check with pre-commit"
2+
on:
3+
- "push"
4+
- "pull_request"
5+
6+
jobs:
7+
8+
check-with-pre-commit:
9+
runs-on: "ubuntu-latest"
10+
strategy:
11+
matrix:
12+
python-version: ["3.11"]
13+
14+
steps:
15+
- uses: "actions/checkout@v3"
16+
17+
- name: "Set up Python ${{ matrix.python-version }}"
18+
uses: "actions/setup-python@v4"
19+
with:
20+
python-version: "${{ matrix.python-version }}"
21+
22+
- name: "Install pre-commit"
23+
run: "pip install pre-commit"
24+
25+
- name: "Run checks with pre-commit"
26+
run: "pre-commit run --all-files --show-diff-on-failure --color always"

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ repos:
33
rev: "v0.0.269"
44
hooks:
55
- id: "ruff"
6+
# NOTE: "--exit-non-zero-on-fix" is important for CI to function
7+
# correctly!
68
args: ["--fix", "--exit-non-zero-on-fix"]
79

810
- repo: "https://github.com/psf/black"

0 commit comments

Comments
 (0)