Clean up ruff lint debt and make CI enforce it#177
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Cleans up every outstanding ruff finding across
tincand/,tincan_gui/,and
tests/(unsorted imports, unused imports, overlong lines, imports notat 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.pyhad two definitions ofset_compose_new_enabled; the second silently won at runtime and haddropped the
setAccessibleName()calls the first one made. The "Newconversation" 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.pyhad a D-Bus error fallback that read anexception-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
conversation_list.pymerge is the one hand-judgment change in anotherwise mechanical diff — worth a glance to confirm the tooltip/
accessibility strings still read right.
.github/workflows/ci.yml: the Lint (ruff) step no longer hascontinue-on-error, so it now blocks the Test step on failure.Test plan
ruff check tincand tincan_gui tests— exit 0main(including interaction with the just-merged fix(calls): self-healing phone reconnect (tincan-c7b8g) #176 self-healingreconnect work)
release-gates/tincan-12wwq-gate.md