Repository navigation
fix: green CI — pin ruff and clear the lint it reports - #2
Merged
Merged
Conversation
CI has been red on main since 2026-05-04, on every push, without a line of source changing in between. The dev extra asked for `ruff>=0.6`, so each run installed whatever ruff was newest that day; the `UP` rules the config selects grew, and code written against ruff 0.6 started failing under 0.15. Pinning is the fix that keeps it from happening again. `ruff check --fix` handled 74 of the 77: `Optional[X]` to `X | None`, import sorting, unused imports. The three left needed a decision: - `pytest.raises(Exception)` in test_pair_init_client now raises on `BadSignatureError`, which the comment beside it already named. As written, a typo raising TypeError passed the tampering test. - `pong_received_times` in test_signaling_keepalive was dead; that test counts pings and never touches pongs. - `WireMessage` becomes a `|` union. Nothing inspects it at runtime — it is only the return annotation of `parse_wire` — so this is a spelling change, and it drops the now-unused `Union` import.
Mechanical, and kept in its own commit so the one before it stays readable. `ruff format --check` is a CI step and 37 of 58 files failed it: quote normalisation and the blank line the formatter now wants after a module docstring. No behaviour anywhere.
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.
CI has been red on
mainsince 2026-05-04 — every push run since then has failed, including commits that changed no Python at all. This makes it green and stops the cause from recurring.Why it broke
The dev extra asked for
ruff>=0.6, so every CI run installed whatever ruff was newest that day. The config selects theUPrule set, which keeps growing: code written against ruff 0.6 fails under 0.15.12 (UP045,UP041,UP037, new import-sorting output). Nothing in the repo had to change for the build to go red.So the first commit pins
ruff==0.15.12. Without the pin, this PR buys a green build until the next ruff release.The 77 errors
ruff check --fixhandled 74 —Optional[X]→X | None, import sorting, unused imports. Three needed a decision, and they are the part worth reviewing:tests/test_pair_init_client.py:179pytest.raises(Exception)now expectsBadSignatureError, the exception the comment beside it already named. As written the test passed on any error, so a typo raisingTypeErrorwould have looked like proof that signature tampering is rejected.tests/test_signaling_keepalive.py:16pong_received_timeswas assigned and never read. That test counts pings and never touches pongs, so the list is leftover, not a missing assertion.transcribe_engine/protocol/messages.py:167WireMessagebecomes a|union. It is only the return annotation ofparse_wireand nothing inspects it at runtime, so this is spelling, and it drops the now-unusedUnionimport.The second commit is noise, on purpose
ruff format --checkis also a CI step, and 37 of 58 files failed it: quote normalisation and the blank line the formatter now wants after a module docstring. I kept it as a separate commit so the first one stays reviewable — readfix:carefully, skimstyle:.This branch is cut from
main, so it does not depend on #1. Merging this one first makes #1 go green on a re-run.