Skip to content

Extend lint coverage to the whole repository and enforce a formatter #89

Closed

Description

@lanyue-llk

Problem

[tool.ruff] include in pyproject.toml covers 239 of 888 tracked .py files. harness/web_fetch, web_search, reporting, lexbench, scripts/, research/*.py and examples/ are only checked for F,TID252 (Makefile lint-check).

An isolated E,F,B,I,UP run finds about 22k issues:

  • 7.7k E501
  • about 1.6k E701/E702 (semicolon or colon one-liners, e.g. stdout.seek(0); raw = stdout.read(limit+1) in providers/headless.py)
  • 676 I001
  • 60 B023 (loop-variable closures, potential bugs)
  • 68 B905 (zip without strict)
  • 55 E402

No formatter runs. ruff format --check would reformat about 783 files. harness/web_fetch/report.py uses one-space indentation on about 1.1k lines.

Proposal (staged, one PR per stage)

  1. Apply ruff's safe autofixes (I001, UP, F401) repo-wide.
  2. Fix B023 and B905 by hand; each finding is either a bug fix or an explicit strict=.
  3. Widen include package by package. Use per-file ignores as a ratchet for the remaining E501 in renderers until those are split (Split giant renderers and functions; add type hints along the way #104).
  4. Run ruff format repo-wide in a single formatting-only commit, listed in .git-blame-ignore-revs. Add ruff format --check to lint-check.
  5. Add rules over time: BLE001, SIM, C901/PLR0915 with baselines, and PLW1514 (see Read and write all text files as explicit UTF-8 #90).

Acceptance

Risk: low per stage, but the diff is large. Depends on: dead-code and script pruning landing first, so deleted files are not reformatted.


Part of the refactor roadmap: #87

Activity

  1. added
    refactor
    on Oct 29, 2026
  2. lanyue-llk commented on Nov 4, 2026

    @lanyue-llk
    ContributorAuthor

    Narrowed after a recheck: fix B023 and B905 by hand, and widen the Ruff include per package while leaving hash-bound files out. A repo-wide format is dropped, because it would move hash-bound sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions