Skip to content

Clear the ruff backlog and re-block the lint in CI (closes #7)#11

Open
johnzfitch wants to merge 4 commits into
masterfrom
claude/ruff-cleanup
Open

Clear the ruff backlog and re-block the lint in CI (closes #7)#11
johnzfitch wants to merge 4 commits into
masterfrom
claude/ruff-cleanup

Conversation

@johnzfitch

Copy link
Copy Markdown
Owner

Closes #7.

CI's ruff check src/ had never actually run (the workflow only triggered on main while the repo lives on master), so ~360 pre-existing style findings had accumulated unenforced. This clears them and restores ruff as a blocking check.

What changed

  • 299 safe auto-fixes (ruff check --fix): Optional[X]X | None (UP045), List/Tuplelist/tuple (UP006), import sorting (I001), assorted pyupgrade (UP024/UP035/UP037/UP015), and whitespace.
  • Manual fixes for the non-auto-fixable: E402/E701/E741 and the long-line E501 wraps — wrapped to the existing 100-char limit (line-length was not relaxed), using hanging indents and implicit string concatenation. No # noqa for E501.
  • Re-enabled the gate: removed continue-on-error from the "Lint with ruff" CI step so it blocks again.

No behavior change

This is style-only — no runtime logic was touched. Verified at each step:

  • ruff check src/All checks passed!
  • pytest tests/302 passed, 9 skipped
  • pyflakes src/pacer_cli + python tools/audit.py → clean

https://claude.ai/code/session_01NNvhsYRVWhjfcdgaSmU5bt


Generated by Claude Code

claude added 4 commits June 10, 2026 04:02
ruff check --fix across src/: Optional[X]->X|None (UP045), List/Tuple->list/
tuple (UP006), import sorting (I001), pyupgrade (UP024/UP035/UP037), and
whitespace. No behavior change; 302 passed, 9 skipped.
- pcl.py: move .auth/.config/.models/.security imports above TypeVar (E402)
- downloader.py: split one-line if-statements onto two lines (E701)
- parser.py: rename ambiguous 'l' to 'ln' (E741)
- security.py/vault.py: add # noqa: N818 to intentionally-named exceptions
- cli.py: strip trailing/blank-line whitespace (W291/W293)

https://claude.ai/code/session_01NNvhsYRVWhjfcdgaSmU5bt
Wrap all remaining long lines without changing runtime behavior or the
line-length config (kept at 100). Breaks long function calls/defs at
commas, long strings via implicit concatenation (content preserved),
and long boolean/conditional expressions with parentheses.

ruff check src/ now reports zero findings; pyflakes and tools/audit.py
stay clean; pytest stays at 302 passed, 9 skipped.

https://claude.ai/code/session_01NNvhsYRVWhjfcdgaSmU5bt
The ~360 pre-existing style findings are fixed (299 auto-fixes + manual line
wraps to the existing 100-char limit, no line-length relaxation, no behavior
change). Remove continue-on-error so ruff gates again. ruff check src/ is clean;
302 passed, 9 skipped; pyflakes + audit clean.
Copilot AI review requested due to automatic review settings June 10, 2026 04:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clears the accumulated ruff lint backlog (primarily via safe auto-fixes and targeted manual formatting) and re-enables ruff check src/ as a blocking CI step now that the workflow triggers correctly on master.

Changes:

  • Modernized type hints across src/ (e.g., Optional[T]T | None, List[T]list[T], Iterator from collections.abc) and applied import/whitespace cleanup.
  • Performed manual formatting fixes to satisfy lint rules (notably line wrapping to the existing 100-char limit).
  • Restored CI enforcement by removing continue-on-error from the ruff lint step.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/pacer_cli/vault.py Updates optional type hints and suppresses N818 for VaultLocked.
src/pacer_cli/selection.py Replaces legacy typing generics with built-in generics and union types.
src/pacer_cli/security.py Modernizes typing/imports and applies minor formatting to satisfy lint rules.
src/pacer_cli/reader.py Wraps long conditions/paths and normalizes exception types (OSError).
src/pacer_cli/pcl.py Updates typing imports/order and optional type hints.
src/pacer_cli/parser.py Minor import ordering and variable rename for lint compliance.
src/pacer_cli/models.py Updates many model field annotations from Optional to `
src/pacer_cli/mcp_server.py Updates typing to modern unions and reformats long expressions.
src/pacer_cli/errors.py Converts legacy typing generics and wraps long strings to line-length.
src/pacer_cli/downloader.py Updates optional types, exception types, and wraps long log/regex lines.
src/pacer_cli/docket_types.py Modernizes annotations and replaces inline conditional return with clearer flow.
src/pacer_cli/courts.py Updates function return annotations and removes Optional usage.
src/pacer_cli/config.py Updates config model annotations and wraps a long call site.
src/pacer_cli/cli.py Updates optional types and applies formatting/import ordering fixes.
src/pacer_cli/auth.py Updates optional type annotations to `
.github/workflows/ci.yml Makes ruff check src/ blocking again by removing continue-on-error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

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

3 participants