Skip to content

Clean up ruff lint debt and make CI enforce it#177

Merged
quad341 merged 4 commits into
mainfrom
builder/tincan-6erin
Jul 5, 2026
Merged

Clean up ruff lint debt and make CI enforce it#177
quad341 merged 4 commits into
mainfrom
builder/tincan-6erin

Conversation

@quad341

@quad341 quad341 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What this changes

Cleans up every outstanding ruff finding across tincand/, tincan_gui/,
and tests/ (unsorted imports, unused imports, overlong lines, imports not
at the top of the file), and flips CI's lint step from advisory to
blocking — a future lint regression now fails the build instead of passing
silently.

Two real fixes surfaced while clearing the lint debt:

  • tincan_gui/conversation_list.py had two definitions of
    set_compose_new_enabled; the second silently won at runtime and had
    dropped the setAccessibleName() calls the first one made. The "New
    conversation" button's screen-reader accessible name was going out
    un-announced. Merged into one method, keeping the current tooltip
    behavior and restoring the accessibility calls.
  • tincand/backends/ancs.py had a D-Bus error fallback that read an
    exception-handler variable that Python has already scoped out by the
    time it's referenced. It happened to work because it was invoked
    inline before the variable was cleared, but it's rewritten as an
    explicit conditional so it isn't relying on that timing.

Review notes

  • The conversation_list.py merge is the one hand-judgment change in an
    otherwise mechanical diff — worth a glance to confirm the tooltip/
    accessibility strings still read right.
  • .github/workflows/ci.yml: the Lint (ruff) step no longer has
    continue-on-error, so it now blocks the Test step on failure.

Test plan

quad341 and others added 4 commits July 5, 2026 08:21
… blocking

73 findings on main (ruff check tincand tincan_gui tests, line-length=99):
21 I001 unsorted-imports + 14 F401 unused-import (ruff --fix), 33 E501
line-too-long (hand-wrapped), 3 E402 module-import-not-at-top (moved to
top of file).

Two real bugs fixed among the findings:
- tincan_gui/conversation_list.py: set_compose_new_enabled was defined
  twice (F811); the second definition silently won at runtime and had
  dropped the setAccessibleName() accessibility calls from the first.
  Merged into one method, keeping the runtime-winning tooltip strings
  and restoring the accessibility calls.
- tincand/backends/ancs.py: the DBusException handler's fallback lambda
  closed over the except-bound name after Python deletes it (F821).
  Rewritten as an explicit conditional.

CI's Lint (ruff) step no longer has continue-on-error, so lint failures
now block the build.

Co-authored-by: Claude <[email protected]>
PR #175 merged two locally-scoped imports that ruff I001 flags once
this branch's CI-blocking lint step is in effect. Reproduces only in
the PR merge-ref against current main, not on this branch in isolation.
@quad341
quad341 merged commit 53c1a3a into main Jul 5, 2026
1 check passed
@quad341
quad341 deleted the builder/tincan-6erin branch July 5, 2026 19:13
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.

1 participant