Skip to content

Commit

Permalink
Merge pull request #4200 from cclauss/patch-2
Browse files Browse the repository at this point in the history
`python3 setup.py lint` is deprecated: Let's lint with `pre-commit`
  • Loading branch information
illume committed Apr 14, 2024
2 parents 9cb30af + d0dc812 commit 9f6523d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/format-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- '**.c'
- '**.py'
- '**.rst'
- '.pre-commit-config.yaml'

pull_request:
branches:
Expand All @@ -21,8 +22,18 @@ on:
- '**.c'
- '**.py'
- '**.rst'
- '.pre-commit-config.yaml'

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.2
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.1

format-lint-code-check:
runs-on: ubuntu-22.04

Expand Down
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Learn more about this config here: https://pre-commit.com/

# To enable these pre-commit hooks run:
# `brew install pre-commit` or `python3 -m pip install pre-commit`
# Then in the project root directory run `pre-commit install`

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
args: [--skip-string-normalization]
exclude: |
(?x)^(
^buildconfig/.*$
| ^docs/reST/.*$
| docs/es/conf.py
| setup.py
)$
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.2
hooks:
- id: clang-format
exclude: |
(?x)^(
^src_c/_sdl2/.*$
| ^src_c/doc/.*$
| docs/reST/_static/script.js
| docs/reST/_templates/header.h
| src_c/include/sse2neon.h
| src_c/pypm.c
| src_c/SDL_gfx/SDL_gfxPrimitives.c
| src_c/SDL_gfx/SDL_gfxPrimitives.h
| src_c/SDL_gfx/SDL_gfxPrimitives_font.h
| src_c/sdlmain_osx.m
)$

0 comments on commit 9f6523d

Please sign in to comment.