From c3018d67e5298434bb2cd821e67009576ed42d27 Mon Sep 17 00:00:00 2001 From: Javier Buzzi Date: Mon, 10 Feb 2025 10:59:22 +0100 Subject: [PATCH] Developer QOL (#1174) This update addresses two common pain points when developing on GitHub.com's browser editor: Delayed CI Testing: Small changes often accumulate, causing the CI to wait for all previous commits before testing your current commit. This delay can be inefficient. Suggestion: Cancel previous CI runs when pushing new commits to speed up the feedback loop. Lack of Fix Suggestions for ruff Issues: When ruff flags an issue, it highlights the problematic code block but doesn't suggest how to fix it. By adding the --diff option, you can see the differences and get guidance on correcting the issue. All this came about while working on #1170 --- .github/workflows/main.yml | 4 ++++ tox.ini | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc1da1c4..886e6a26 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,10 @@ on: branches: - main +concurrency: + group: ci-main-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + env: PYTEST_ADDOPTS: "--color=yes" diff --git a/tox.ini b/tox.ini index d9ce1c6d..85f996bd 100644 --- a/tox.ini +++ b/tox.ini @@ -53,7 +53,7 @@ deps = ruff==0.9.5 mypy==1.15.0 commands = - ruff check {posargs:pytest_django pytest_django_test tests} + ruff check --diff {posargs:pytest_django pytest_django_test tests} ruff format --quiet --diff {posargs:pytest_django pytest_django_test tests} mypy {posargs:pytest_django pytest_django_test tests}