From e5a3d1eda7a9c882e3301d1526c4f0940a0f496a Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sat, 22 Aug 2026 16:34:27 +0200 Subject: [PATCH] Apply the ruff fix CI's --unsafe-fixes run wanted `crdt-sync pre-commit` went red on the previous two commits: pytest is only referenced in annotations in the _cli split, so TC002 moves it into the type-checking block. Missed locally because I ran `ruff check` directly, while the hook passes `--fix --unsafe-fixes --exit-non-zero-on-fix`. TC002's fix is classed unsafe, so a bare `ruff check` reports nothing and CI still rewrites the file. The lesson generalises past this file: for this repo, `pre-commit run --all-files` is the check, not `ruff check` -- the same trap the prompt already recorded for re-export pruning. Verified after the fix: 18 tests, tool/google_id_token.py still 100% branch, and `pre-commit run --config crdt-sync/.pre-commit-config.yaml --all-files` clean end to end. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01CFSGeWxHPY5rHUGrPqhcmG --- crdt-sync/crdt_sync/tests/test_tool_google_id_token_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crdt-sync/crdt_sync/tests/test_tool_google_id_token_cli.py b/crdt-sync/crdt_sync/tests/test_tool_google_id_token_cli.py index a41290c..abbc6a9 100644 --- a/crdt-sync/crdt_sync/tests/test_tool_google_id_token_cli.py +++ b/crdt-sync/crdt_sync/tests/test_tool_google_id_token_cli.py @@ -15,8 +15,6 @@ import logging from typing import TYPE_CHECKING from unittest.mock import patch -import pytest - from crdt_sync.tests.test_tool_google_id_token import ( _CLIENT_CREDENTIAL, _CLIENT_ID, @@ -27,6 +25,8 @@ from tool import google_id_token as git if TYPE_CHECKING: from pathlib import Path + import pytest + def test_main_prints_the_token_when_no_output_is_given( caplog: pytest.LogCaptureFixture,