From 9adeebdcae9e899b8804d38994021685c5e64fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Sun, 14 Dec 2025 00:24:44 +0300 Subject: [PATCH 1/5] Update pre-commit hooks --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2076d158..846d93d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,23 +3,23 @@ default_language_version: python: python3.13 repos: - repo: https://github.com/adamchainz/django-upgrade - rev: 1.24.0 + rev: 1.29.1 hooks: - id: django-upgrade args: [--target-version, "5.2"] - repo: https://github.com/ambv/black - rev: 24.4.2 + rev: 25.12.0 hooks: - id: black - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.11.7 + rev: v0.14.9 hooks: - id: ruff - repo: https://github.com/asottile/pyupgrade - rev: v3.19.1 + rev: v3.21.2 hooks: - id: pyupgrade args: From 237621e7abce598f2cfac4d1f09d0d3b93bb9139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Sun, 14 Dec 2025 00:27:22 +0300 Subject: [PATCH 2/5] Don't use legacy hook for ruff linter --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 846d93d8..8fa648c1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.9 hooks: - - id: ruff + - id: ruff-check - repo: https://github.com/asottile/pyupgrade rev: v3.21.2 From 9566c15ef3957da541247efe0f9b41d7265e8311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Sun, 14 Dec 2025 00:28:14 +0300 Subject: [PATCH 3/5] Enable automatic fixes with ruff linter --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8fa648c1..7068e1fe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,6 +17,7 @@ repos: rev: v0.14.9 hooks: - id: ruff-check + args: ["--fix"] - repo: https://github.com/asottile/pyupgrade rev: v3.21.2 From c52fa711c058b3c360e6fc0a84777be15a94d21a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Sun, 14 Dec 2025 00:29:09 +0300 Subject: [PATCH 4/5] Replace black with ruff formatter https://github.com/classy-python/ccbv/pull/236#discussion_r1612164833 --- .pre-commit-config.yaml | 6 +----- cbv/models.py | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7068e1fe..f9739ca6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,16 +8,12 @@ repos: - id: django-upgrade args: [--target-version, "5.2"] - - repo: https://github.com/ambv/black - rev: 25.12.0 - hooks: - - id: black - - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.9 hooks: - id: ruff-check args: ["--fix"] + - id: ruff-format - repo: https://github.com/asottile/pyupgrade rev: v3.21.2 diff --git a/cbv/models.py b/cbv/models.py index dddae0d3..7090bf85 100644 --- a/cbv/models.py +++ b/cbv/models.py @@ -306,7 +306,9 @@ def basic_yuml_data(self, first: bool = False) -> list[str]: child_col=( "green" if first - else "white" if self.is_secondary() else "lightblue" + else "white" + if self.is_secondary() + else "lightblue" ), ) ) From 296c8a44ca972843873f15e1b2b5fc513000be03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Clgen=20Sar=C4=B1kavak?= Date: Sun, 14 Dec 2025 00:48:41 +0300 Subject: [PATCH 5/5] Remove duplicate pyupgrade setup Already enabled as a ruff rule set Relates to https://github.com/classy-python/ccbv/pull/236 --- .pre-commit-config.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f9739ca6..fad7a52a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,10 +14,3 @@ repos: - id: ruff-check args: ["--fix"] - id: ruff-format - - - repo: https://github.com/asottile/pyupgrade - rev: v3.21.2 - hooks: - - id: pyupgrade - args: - - --py313-plus