From 9e7b75bb0f6f6649fb00f2dc97059e90b7d52875 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 19 Sep 2026 14:39:38 +0200 Subject: style: the 98 ruff could not fix, so the linter is a signal again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The pass before this applied ruff's own fixes. These are the ones needing a decision, and the point of doing them is that `ruff check .` now passes: a linter reporting 98 known-acceptable findings reports nothing, because the next real one arrives invisible. **Lines over 100 (70).** Mostly wrapped where they stood. Two exceptions: the aligned trailing comments in `protocol.py`'s message table were shortened rather than wrapped, because wrapping one row of a table breaks the table; and in `models.py` the column comments moved above their columns for the same reason. **Imports below the first statement (14).** `csam.py` kept its FastAPI imports under a section header halfway down the file; two node tests had a constant and a `pytestmark` wedged between two import blocks. Moved, not suppressed. **Bindings nothing reads (4).** Three in tests, where the call stays and only the name goes — `_user(client, "listener")` is there to create the user, not to return one. The fourth was in `revocation.py` and was not a lint finding at all: `_connect_and_listen` opened an httpx stream to the WebSocket URL, did `pass`, and then opened the real connection through the `websockets` library. One pointless request per connect, left over from before that library was used directly. Removed, and `httpx` with it. **`l` as a name (4)**, **semicolons (6)** in the POC spikes, and the rest. 2893 passed, the same count as the two commits before it. `meshbay_node/revocation.py` is worth a decision separately: 154 lines that nothing imports, superseded by `hub_client.maintain_ws`'s `on_revocation`. This commit only stopped it failing the linter. Co-Authored-By: Claude Opus 5 --- packages/meshbay-node/tests/test_packaging_win.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/meshbay-node/tests/test_packaging_win.py') diff --git a/packages/meshbay-node/tests/test_packaging_win.py b/packages/meshbay-node/tests/test_packaging_win.py index 7b44bbe..aa77c29 100644 --- a/packages/meshbay-node/tests/test_packaging_win.py +++ b/packages/meshbay-node/tests/test_packaging_win.py @@ -1230,13 +1230,14 @@ def test_service_mode_ps1_starts_the_task_after_installing_it(): already-running task pointlessly on every mode switch away from service. """ src = (WIN / "service-mode.ps1").read_text(encoding="utf-8") - install_branch, remove_branch = src.split('$Action -eq "install"', 1)[1], None + install_branch = src.split('$Action -eq "install"', 1)[1] assert '"run"' in install_branch or "'run'" in install_branch, ( "service-mode.ps1 registers the task but never starts it -- the " "daemon stays down until the next reboot") # The run step must be conditioned on install having actually succeeded, # not fired unconditionally regardless of $Action. - guard_line = src[src.index('$Action -eq "install"') - 40:src.index('$Action -eq "install"') + 40] + at = src.index('$Action -eq "install"') + guard_line = src[at - 40:at + 40] assert "-and" in guard_line or "-not $failed" in install_branch, ( "the follow-up `run` must be gated on Action=install and success, " "not run unconditionally on every invocation including remove") -- cgit v1.2.3