Skip to content

Commit

Permalink
cicd(python): run precommit hooks in CI (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Oct 7, 2024
1 parent 02ac81d commit b618d74
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions python/{{cookiecutter.project_slug}}/.github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ jobs:
- name: Check style
run: python3 -m ruff check . && python3 -m ruff format --check .

precommit_hooks:
runs-on: ubuntu-latest
strategy:
matrix:
hook:
- name: "Check EOF format"
args: "end-of-file-fixer --all-files"
- name: "Check trailing whitespace"
args: "trailing-whitespace --all-files"
- name: "Check line ending format"
args: "mixed-line-ending --fix=lf --all-files"
steps:
- uses: actions/checkout@v3

- name: {{ "${{ matrix.hook.name }}" }}
uses: pre-commit/[email protected]
with:
extra_args: {{ "${{ matrix.hook.args }}" }}

{% if cookiecutter.add_docs %}
docs:
runs-on: ubuntu-latest
Expand Down

0 comments on commit b618d74

Please sign in to comment.