Skip to content

Adopt ruff as an enforced gate (CI + pre-commit) and clear the existing findings #733

Description

@aallan

Problem

ruff ships in the [dev] extras but nothing runs it — installed-but-unenforced, so findings accumulate silently. Measured today (2026-06-12, default rule set):

Scope Findings
vera/ 70 — 29×F401 unused-import, 18×F541 f-string-without-placeholders, 8×E702 multi-statement-semicolon, 8×F841 unused-variable, 3×E402, 2×F811, 1×E721, 1×E741
vera/ + scripts/ + tests/ 178 total (136 auto-fixable)

Notable in the tail:

  • Three scripts define a skip_langs set that is never used (scripts/check_skill_examples.py:178, scripts/check_readme_examples.py:75, scripts/check_examples_doc.py:75 — only check_spec_examples.py consumes its copy). Dead code that looks load-bearing.
  • 5×F821 in tests/test_codegen_modules.py — string annotations referencing a type imported inside the function body. Harmless at runtime today, but precisely the kind of finding that rots into a real bug.

Plan

  1. ruff check --fix the 136 auto-fixables; manually triage the rest, including deleting the dead skip_langs sets.
  2. Add ruff check (default rules) to .pre-commit-config.yaml and the CI lint job.
  3. Default rules only for now — rule-set expansion (pyupgrade, isort, etc.) is a separate later conversation.

Audit reference: §0.1 and Open Question 1 (enforce the tools you install). Size: S.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciCI/CD and GitHub ActionstoolingIssue around tooling built for the language (e.g. package managers, IDE plug-ins)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions