Skip to content
27 changes: 19 additions & 8 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ jobs:

precommit_hooks:
runs-on: ubuntu-latest
strategy:
matrix:
cmd:
- "end-of-file-fixer"
- "trailing-whitespace"
- "mixed-line-ending"
continue-on-error: true
steps:
- uses: actions/checkout@v4

Expand All @@ -90,9 +85,25 @@ jobs:
with:
python-version: 3.12

- uses: pre-commit/action@v3.0.1
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
extra_args: ${{ matrix.cmd }} --all-files
enable-cache: true

- name: Add precommit
run: uv pip install pre-commit
env:
UV_SYSTEM_PYTHON: 1

- name: Pre-commit checks
run: |
status=0
pre-commit run end-of-file-fixer -v --all-files --show-diff-on-failure --color always || status=1
pre-commit run mixed-line-ending -v --all-files --show-diff-on-failure --color always || status=1
pre-commit run trailing-whitespace -v --all-files --show-diff-on-failure --color always || status=1
exit $status


docs:
runs-on: ubuntu-latest
env:
Expand Down