fix(ci): pin ruff and declare explicit lint rule set - #3
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lint started failing on unchanged code: ruff was installed unpinned and
pyproject.tomlhad noselect, so the repo inherited ruff's defaults — which changed in 0.16 (added BLE001/ASYNC230/DTZ005/I001/UP006, dropped E402, turning existing# noqa: E402into RUF100).Fix: pin
ruff==0.16.1and 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.