Skip to content

fix(ci): pin ruff and declare explicit lint rule set - #3

Merged
FaustoS88 merged 1 commit into
mainfrom
fix/ci-ruff-pin
Aug 3, 2026
Merged

FaustoS88 merged 1 commit into
mainfrom
fix/ci-ruff-pin

Conversation

@FaustoS88

@FaustoS88 FaustoS88 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Lint started failing on unchanged code: ruff was installed unpinned and pyproject.toml had no select, so the repo inherited ruff's defaults — which changed in 0.16 (added BLE001/ASYNC230/DTZ005/I001/UP006, dropped E402, turning existing # noqa: E402 into RUF100).

Fix: pin ruff==0.16.1 and declare the rule set explicitly (E, W, F, I, UP, B, C4, SIM, PIE, DTZ, RUF). All findings fixed rather than suppressed. BLE001/ASYNC230 intentionally not selected.

Also finished the Pydantic AI v2 migration that had left the suite at 16 failed / 89 passed (Dependencies fields, output_type, retrieve/hybrid_retrieve boundary, v5→v6 labels, api_debug.py OpenAIChatModel).

Result: lint clean on 0.16.1 and 0.15.4, 106 tests pass.

The Lint job started failing on an unchanged commit: 5cf2aa1 passed on
Jul 21 and failed on Aug 3 with 96 errors. The code never changed — ruff
did. The workflow installed ruff unpinned and pyproject declared
[tool.ruff] with no `select`, so the project inherited ruff's *default*
rule set. ruff 0.16 shipped a much broader default (adding BLE001,
ASYNC230, DTZ005, EXE001, I001, UP006, ...) and dropped E402, which also
turned the existing `# noqa: E402` comments into RUF100 unused-noqa.

Root-cause fix, so a future ruff release cannot break a green build:

- pin ruff==0.16.1 in the Lint workflow
- declare the rule set explicitly in pyproject: E, W, F, I, UP, B, C4,
  SIM, PIE, DTZ, RUF

Resolved every finding under that set for real rather than suppressing:
import sorting, PEP 585/604 annotations, datetime.UTC, tuple-form
startswith, sorted() over a set, f-string conversion flags, combined with
statements, and explicit zip(strict=True) where the lists are built in
lockstep. Long lines wrapped instead of ignored.

BLE001 and ASYNC230 are deliberately not selected: broad `except
Exception` is intentional log-and-continue behaviour in the CLI scripts,
and blocking file IO is fine in the one-shot crawler/eval scripts.
Selecting them would have meant ~31 noqa comments across 12 files.

Also completes the Pydantic AI v2 migration, which had left the suite at
16 failed / 89 passed:

- Dependencies dropped openrouter_api_key/use_openrouter; tests updated
  and OpenRouter routing now covered via resolve_model()
- agent introspection renamed: _function_tools -> the Capability's
  toolset, result_type -> output_type
- retrieve() delegates to hybrid_retrieve, so its tests patch that
  boundary instead of mocking pool.fetch internals
- chunk-header assertions updated v5 -> v6
- api_debug.py: OpenAIModel -> OpenAIChatModel, api_key moved onto
  OpenAIProvider, removed the no-longer-callable direct model invocation,
  result.data -> result.output

Verified: ruff clean under both 0.16.1 and 0.15.4, 106 tests pass, all
modules import.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E9VRuDYsPBrRsbDCRrJVHb
@FaustoS88
FaustoS88 merged commit 990042d into main Aug 3, 2026
2 checks passed
@FaustoS88
FaustoS88 deleted the fix/ci-ruff-pin branch August 3, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant