Skip to content

Ruff cleanup: clear ~356 pre-existing style findings, then re-block the lint in CI #7

@johnzfitch

Description

@johnzfitch

Background

The CI workflow runs ruff check src/, but the workflow only triggered on branches: [main] while the repo's default branch is master — so the lint had never actually run. Enabling CI (PR #6) surfaced a backlog of ~356 pre-existing, repo-wide style findings. To avoid gating unrelated work, the ruff step was made advisory (continue-on-error: true) in PR #6.

This issue tracks clearing that backlog and restoring ruff as a blocking check.

Breakdown (at time of filing)

Total: 356 findings. None are real bugs (F/pyflakes is clean; tools/audit.py is clean). Dominant rules:

Rule Count What
UP045 216 Optional[X] → `X
E501 56 line too long
W293 38 whitespace on blank line
UP006 10 List/Tuplelist/tuple
E701 8 multiple statements on one line
UP035/UP037/UP024/UP015 ~15 misc pyupgrade
I001 5 import sorting
E402 4 module import not at top
N818 2 exception not named *Error (VaultLocked, MatterRequired)
E741 1 ambiguous variable name

Most-affected files: models.py (103), cli.py, downloader.py (36), docket_types.py (15), courts.py (13), selection.py (11).

Suggested plan

  1. ruff check src/ --fix for the ~280 auto-fixable findings; review --unsafe-fixes separately.
  2. Hand-fix the rest (N818 renames, E701/E741, any remaining E501).
  3. Run the full test suite + tools/audit.py to confirm no behavior change.
  4. Remove continue-on-error: true from the "Lint with ruff" step in .github/workflows/ci.yml so it blocks again.

Best done as its own PR so the reformat doesn't mix with feature work.

https://claude.ai/code/session_01NNvhsYRVWhjfcdgaSmU5bt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions