From f18a4343fdc513b72905381067ea96b04e5207da Mon Sep 17 00:00:00 2001 From: mbakalarski <64490638+mbakalarski@users.noreply.github.com> Date: Fri, 23 Oct 2026 12:33:35 +0000 Subject: [PATCH] Check lint and format in CI, with hatch check Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci-with-bnp.yaml | 4 +++- .github/workflows/ci.yaml | 4 +++- pyproject.toml | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-with-bnp.yaml b/.github/workflows/ci-with-bnp.yaml index 26c74a3..08c4c53 100644 --- a/.github/workflows/ci-with-bnp.yaml +++ b/.github/workflows/ci-with-bnp.yaml @@ -45,7 +45,9 @@ jobs: - name: Install Hatch run: pipx install hatch==${{ env.HATCH_VERSION }} - name: Lint - run: hatch fmt + run: hatch check code + - name: Format + run: hatch check fmt unit-test: runs-on: ubuntu-24.04 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f06a647..8c07fc3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,7 +32,9 @@ jobs: - name: Install Hatch run: pipx install hatch==${{ env.HATCH_VERSION }} - name: Lint - run: hatch fmt + run: hatch check code + - name: Format + run: hatch check fmt unit-test: runs-on: ubuntu-24.04 diff --git a/pyproject.toml b/pyproject.toml index f874bce..85131c9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,11 +48,15 @@ dependencies = ["ipython==9.4.0"] [tool.hatch.envs.default.scripts] development = "python function/main.py --insecure --debug" -# This special environment is used by hatch fmt. -[tool.hatch.envs.hatch-static-analysis] +# These special environments are used by hatch check code and hatch check fmt. +[tool.hatch.envs.hatch-check-code] dependencies = ["ruff==0.12.7"] config-path = "none" # Disable Hatch's default Ruff config. +[tool.hatch.envs.hatch-check-fmt] +dependencies = ["ruff==0.12.7"] +config-path = "none" + [tool.ruff] target-version = "py313" exclude = ["function/proto/*"]