Skip to content

[REFACTOR] Ruff: cosmetic residue (string-embedded whitespace, naive datetime, misc) #475

Closed

Description

@squid-protocol

Objective

The long tail of the ruff lint baseline (#469) -- lowest-value findings, mostly whitespace inside string literals that neither `ruff check --fix` nor `ruff format` will touch (touching string content could change program behavior, so both tools correctly leave it alone).

Rule Count What it flags
`W291` 36 trailing whitespace (inside a string literal -- e.g. embedded CLI help text)
`W293` 16 blank line with whitespace (same -- inside a string literal)
`DTZ005` 3 `datetime.now()` without a timezone (naive datetime -- real correctness concern if these ever cross a timezone boundary, worth checking each)
`UP045` 3 `Optional[X]` could be `X | None` (PEP 604 syntax, requires no further Python-version gymnastics since this project already only supports 3.9 as a floor and `from future import annotations` handles runtime evaluation where needed -- confirm per-file before batch-converting)
`E402` 2 import not at the top of the file (the same pattern already caught and fixed once during the mypy epic in `cobol_refractor_controller.py` -- these 2 are new/different instances)
`DTZ007` 1 `datetime.strptime()` without timezone
`RUF001`/`RUF003` 1 each ambiguous Unicode character in a string/comment (e.g. a lookalike character that could be confused with ASCII)

63 findings total. Fix opportunistically -- there's no urgency here, and several of these (W291/W293) may not be worth touching at all if the embedded whitespace is intentional formatting inside a CLI help string.

Fix in small PRs, removing resolved entries from `tests/ruff_audit_baseline.json` (#469) as each is resolved.

Parent: #469

Activity

  1. added
    python
    refactor
    priority: low
    on Jul 25, 2026
  2. squid-protocol commented on Jul 26, 2026

    @squid-protocol
    OwnerAuthor

    Split into smaller, self-contained chunks for good-first-issue accessibility instead of one 63-finding sub-issue: #499, #500, #501, #502, #503, #504. Closing this in favor of those.

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

    priority: lowpythonrefactor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions