From 0cce25aeabbbdc456221514b9653a4f24c5c0493 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 20:30:33 +0000 Subject: [PATCH] ci: remove auto-format job, add format check to tests Remove the separate format job that auto-committed formatting fixes, which caused issues with GitHub Actions not re-running after the auto-merge. Instead, add format checks as a step in the tests job that will fail if code is not properly formatted. --- .github/workflows/validate.yml | 58 ++-------------------------------- 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 68c78a32..ac8cadd3 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -4,18 +4,12 @@ on: pull_request: branches: ["*"] -permissions: - contents: write - jobs: - format: + tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.GITHUB_TOKEN }} - name: Install uv uses: astral-sh/setup-uv@v4 @@ -30,56 +24,10 @@ jobs: - name: Install dependencies run: uv sync --extra dev - - name: Run ruff formatting - run: uv run ruff format src/ tests/ - - - name: Run ruff linting with auto-fix - run: uv run ruff check --fix src/ tests/ - - - name: Re-run formatting after auto-fix - run: uv run ruff format src/ tests/ - - - name: Verify all issues are fixed + - name: Check formatting (ruff) run: | - uv run ruff check src/ tests/ uv run ruff format --check src/ tests/ - - - name: Check for changes - id: check_changes - run: | - if [[ -n "$(git status --porcelain)" ]]; then - echo "has_changes=true" >> $GITHUB_OUTPUT - else - echo "has_changes=false" >> $GITHUB_OUTPUT - fi - - - name: Commit and push formatting changes - if: steps.check_changes.outputs.has_changes == 'true' - run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add -A - git commit -m "style: auto-format code with ruff" - git push - - tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Install uv - uses: astral-sh/setup-uv@v4 - with: - version: "latest" - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Install dependencies - run: uv sync --extra dev + uv run ruff check src/ tests/ - name: Run tests run: uv run pytest tests/ -v