diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fff072d..b1d63a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,13 +28,13 @@ jobs: if: steps.setup-rye.outputs.cache-hit != 'true' run: | rye sync - - name: Cache pre-commit - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + - name: Cache prek + uses: actions/cache@v4 with: - path: ~/.cache/pre-commit - key: pre-commit-|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }} + path: ~/.cache/prek + key: prek-|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }} - name: Lint run: | - rye run pre-commit run --all-files + rye run prek run --all-files - name: Lint GitHub Actions uses: eifinger/actionlint-action@v1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e022f5c..ece44f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,58 +17,20 @@ repos: - id: prettier name: 💄 Ensuring files are prettier types: [yaml, json, markdown] - - repo: local + - repo: builtin hooks: - - id: check-ast - name: 🐍 Check Python AST - language: system - types: [python] - entry: rye run check-ast - - id: check-case-conflict - name: 🔠 Check for case conflicts - language: system - entry: rye run check-case-conflict - - id: check-docstring-first - name: â„šī¸ Check docstring is first - language: system - types: [python] - entry: rye run check-docstring-first - - id: check-executables-have-shebangs - name: 🧐 Check that executables have shebangs - language: system - types: [text, executable] - entry: rye run check-executables-have-shebangs - stages: [commit, push, manual] + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml - id: check-json - name: īŊ› Check JSON files - language: system - types: [json] - entry: rye run check-json + - id: check-toml - id: check-merge-conflict - name: đŸ’Ĩ Check for merge conflicts - language: system - types: [text] - entry: rye run check-merge-conflict + - id: detect-private-key + - id: check-executables-have-shebangs + stages: [commit, push, manual] - id: check-symlinks - name: 🔗 Check for broken symlinks - language: system - types: [symlink] - entry: rye run check-symlinks - - id: check-toml - name: ✅ Check TOML files - language: system - types: [toml] - entry: rye run check-toml - - id: check-xml - name: ✅ Check XML files - entry: check-xml - language: system - types: [xml] - - id: check-yaml - name: ✅ Check YAML files - language: system - types: [yaml] - entry: rye run check-yaml + - repo: local + hooks: - id: codespell name: ✅ Check code for common misspellings language: system @@ -80,27 +42,6 @@ repos: docs/openapi_v8.yaml )$ entry: rye run codespell --ignore-words=.codespell - - id: debug-statements - name: đŸĒĩ Debug Statements and imports (Python) - language: system - types: [python] - entry: rye run debug-statement-hook - - id: detect-private-key - name: đŸ•ĩī¸ Detect Private Keys - language: system - types: [text] - entry: rye run detect-private-key - - id: end-of-file-fixer - name: ⎐ Fix End of Files - language: system - types: [text] - entry: rye run end-of-file-fixer - stages: [commit, push, manual] - - id: fix-byte-order-marker - name: 🚏 Fix UTF-8 byte order marker - language: system - types: [text] - entry: rye run fix-byte-order-marker - id: mypy name: 🆎 Static type checking using mypy language: system @@ -113,12 +54,6 @@ repos: types: [python] entry: rye run pytest pass_filenames: false - - id: trailing-whitespace - name: ✄ Trim Trailing Whitespace - language: system - types: [text] - entry: rye run trailing-whitespace-fixer - stages: [commit, push, manual] - id: yamllint name: 🎗 Check YAML files with yamllint language: system diff --git a/pyproject.toml b/pyproject.toml index fc43b90..6539d0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,8 +40,7 @@ dev-dependencies = [ "aresponses>=3.0.0", "codespell>=2.3.0", "mypy>=1.10.1", - "pre-commit>=3.7.1", - "pre-commit-hooks>=4.6.0", + "prek>=0.3.0", "pytest>=8.2.2", "pytest-cov>=5.0.0", "pytest-asyncio>=0.23.7",