Skip to content

Commit c5d94f4

Browse files
committed
lint with pre-commit
1 parent ca77b33 commit c5d94f4

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/format-lint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- '**.c'
1212
- '**.py'
1313
- '**.rst'
14+
- '.pre-commit-config.yaml'
1415

1516
pull_request:
1617
branches: main
@@ -19,12 +20,22 @@ on:
1920
- '**.c'
2021
- '**.py'
2122
- '**.rst'
23+
- '.pre-commit-config.yaml'
2224

2325
concurrency:
2426
group: ${{ github.workflow }}-${{ github.ref }}-format-lint
2527
cancel-in-progress: true
2628

2729
jobs:
30+
pre-commit:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/[email protected]
34+
- uses: actions/setup-python@v5
35+
with:
36+
python-version: 3.x
37+
- uses: pre-commit/[email protected]
38+
2839
format-lint-code-check:
2940
runs-on: ubuntu-22.04
3041

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Learn more about this config here: https://pre-commit.com/
2+
3+
# To enable these pre-commit hooks run:
4+
# `brew install pre-commit` or `python3 -m pip install pre-commit`
5+
# Then in the project root directory run `pre-commit install`
6+
7+
repos:
8+
- repo: https://github.com/psf/black-pre-commit-mirror
9+
rev: 24.3.0
10+
hooks:
11+
- id: black
12+
exclude: |
13+
(?x)^(
14+
^buildconfig/.*$
15+
| ^docs/reST/.*$
16+
| setup.py
17+
)$
18+
19+
20+
- repo: https://github.com/pre-commit/mirrors-clang-format
21+
rev: v18.1.2
22+
hooks:
23+
- id: clang-format
24+
exclude: |
25+
(?x)^(
26+
^src_c/_sdl2/.*$
27+
| ^src_c/doc/.*$
28+
| docs/reST/_static/script.js
29+
| docs/reST/_templates/header.h
30+
| src_c/include/sse2neon.h
31+
| src_c/pypm.c
32+
)$

0 commit comments

Comments
 (0)