From cc58a322f526f4b26687d73dd71c51195e44c1c1 Mon Sep 17 00:00:00 2001 From: Willem-Jan van Rootselaar Date: Mon, 23 Feb 2026 11:43:51 +0100 Subject: [PATCH 1/2] Refactor linting workflow and remove deprecated typing job for improved CI efficiency --- .github/workflows/linting.yaml | 116 ++------------------------------- .github/workflows/typing.yaml | 36 ---------- 2 files changed, 6 insertions(+), 146 deletions(-) delete mode 100644 .github/workflows/typing.yaml diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index 169fc1c8..fbf06e32 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -16,8 +16,8 @@ env: DEFAULT_PYTHON: "3.13" jobs: - codespell: - name: codespell + lint: + name: Prek hooks runs-on: ubuntu-latest steps: - name: โคต๏ธ Check out code from GitHub @@ -33,114 +33,10 @@ jobs: python-version: ${{ env.DEFAULT_PYTHON }} - name: ๐Ÿ— Install Python dependencies run: uv sync --dev - - name: ๐Ÿš€ Check code for common misspellings - run: uv run prek run codespell --all-files - - ruff: - name: Ruff - runs-on: ubuntu-latest - steps: - - name: โคต๏ธ Check out code from GitHub - uses: actions/checkout@v6.0.2 - - name: ๐Ÿ— Set up uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - - name: ๐Ÿ— Install Python dependencies - run: uv sync --dev - - name: ๐Ÿš€ Run ruff linter - run: uv run ruff check --output-format=github . - - name: ๐Ÿš€ Run ruff formatter - run: uv run ruff format --check . - - prek-hooks: - name: prek-hooks - runs-on: ubuntu-latest - steps: - - name: โคต๏ธ Check out code from GitHub - uses: actions/checkout@v6.0.2 - - name: ๐Ÿ— Set up uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - - name: ๐Ÿ— Install Python dependencies - run: uv sync --dev - - name: ๐Ÿš€ Check Python AST - run: uv run prek run check-ast --all-files - - name: ๐Ÿš€ Check for case conflicts - run: uv run prek run check-case-conflict --all-files - - name: ๐Ÿš€ Check docstring is first - run: uv run prek run check-docstring-first --all-files - - name: ๐Ÿš€ Check that executables have shebangs - run: uv run prek run check-executables-have-shebangs --all-files - - name: ๐Ÿš€ Check JSON files - run: uv run prek run check-json --all-files - - name: ๐Ÿš€ Check for merge conflicts - run: uv run prek run check-merge-conflict --all-files - - name: ๐Ÿš€ Check for broken symlinks - run: uv run prek run check-symlinks --all-files - - name: ๐Ÿš€ Check TOML files - run: uv run prek run check-toml --all-files - - name: ๐Ÿš€ Check XML files - run: uv run prek run check-yaml --all-files - - name: ๐Ÿš€ Check YAML files - run: uv run prek run check-yaml --all-files - - name: ๐Ÿš€ Detect Private Keys - run: uv run prek run detect-private-key --all-files - - name: ๐Ÿš€ Check End of Files - run: uv run prek run end-of-file-fixer --all-files - - name: ๐Ÿš€ Trim Trailing Whitespace - run: uv run prek run trailing-whitespace --all-files - - pylint: - name: pylint - runs-on: ubuntu-latest - steps: - - name: โคต๏ธ Check out code from GitHub - uses: actions/checkout@v6.0.2 - - name: ๐Ÿ— Set up uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - - name: ๐Ÿ— Install Python dependencies - run: uv sync --dev - - name: ๐Ÿš€ Run pylint - run: uv run prek run pylint --all-files - - yamllint: - name: yamllint - runs-on: ubuntu-latest - steps: - - name: โคต๏ธ Check out code from GitHub - uses: actions/checkout@v6.0.2 - - name: ๐Ÿ— Set up uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - - name: ๐Ÿ— Install Python dependencies - run: uv sync --dev - - name: ๐Ÿš€ Run yamllint - run: uv run yamllint . + - name: ๐Ÿš€ Run all prek hooks + run: >- + uv run prek run --all-files + --hook-stage manual prettier: name: Prettier diff --git a/.github/workflows/typing.yaml b/.github/workflows/typing.yaml deleted file mode 100644 index 3ee480ae..00000000 --- a/.github/workflows/typing.yaml +++ /dev/null @@ -1,36 +0,0 @@ ---- -name: Typing - -# yamllint disable-line rule:truthy -on: - push: - branches: [main] - pull_request: - branches: [main] - workflow_dispatch: - -env: - DEFAULT_PYTHON: "3.13" - -jobs: - ty: - name: ty - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - name: โคต๏ธ Check out code from GitHub - uses: actions/checkout@v6.0.2 - - name: ๐Ÿ— Set up uv - uses: astral-sh/setup-uv@v7 - with: - enable-cache: true - - name: ๐Ÿ— Set up Python ${{ env.DEFAULT_PYTHON }} - id: python - uses: actions/setup-python@v6.2.0 - with: - python-version: ${{ env.DEFAULT_PYTHON }} - - name: ๐Ÿ— Install dependencies - run: uv sync --dev - - name: ๐Ÿš€ Run ty - run: uv run ty check examples src tests From 4123ccd3fecb5cb6c70c6a630546e46dc9b63467 Mon Sep 17 00:00:00 2001 From: Willem-Jan van Rootselaar Date: Mon, 23 Feb 2026 11:49:03 +0100 Subject: [PATCH 2/2] Update linting workflow to set SKIP environment variable for manual hook stage execution --- .github/workflows/linting.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linting.yaml b/.github/workflows/linting.yaml index fbf06e32..10c91cb9 100644 --- a/.github/workflows/linting.yaml +++ b/.github/workflows/linting.yaml @@ -34,9 +34,9 @@ jobs: - name: ๐Ÿ— Install Python dependencies run: uv sync --dev - name: ๐Ÿš€ Run all prek hooks - run: >- - uv run prek run --all-files - --hook-stage manual + env: + SKIP: no-commit-to-branch + run: uv run prek run --all-files prettier: name: Prettier