Sort validation.py's leaf imports so ruff's isort rule passes - #89
Sort validation.py's leaf imports so ruff's isort rule passes#89leaf-agent wants to merge 1 commit into
Conversation
|
Another occurrence, and the earliest one: run 33154672429 is the push run for c4b7444 itself, so |
|
The red Read together, the two open fixes cross-validate: each one's own target job is green, and each one's red job is the other's defect. Merging both greens
Both failures recurred again on run 33156005325 (commit 437cfa3), which is what prompted this check. Nothing new to fix — recording the pairing so the red check on a pure import reorder does not read as a regression. |
|
Superseded — closing. 5689178 ("Split validation by input boundary") deleted
|
…passes (#94) `lint` is red on main: `ruff format` rewrites `tests/test_render_conversations.py`, so `pre-commit` reports "files were modified by this hook" and the job fails. The two asserts [dbfaeaa](dbfaeaa) ("End cancelled panel gestures") added carry ruff's older assert shape — condition wrapped in parentheses, message trailing — where 0.16.1 puts the message in parentheses after a bare condition. This commit applies `ruff@0.16.1 format`, which is the hook's own output; there is no other change. Verified on the branch (rebased onto `ea2f4e7`, main's current head): `ruff@0.16.1 format --check .` → `123 files already formatted`, and `ruff@0.16.1 check --no-fix .` → `All checks passed!`. The `test` job was already green on the failing run, and this diff is whitespace and parentheses only, so behaviour is unchanged; the touched test collects (its local run stops at `BrowserType.launch` — no Playwright browser in the tend sandbox). <details><summary>The hook's diff, from the failed run</summary> ```diff @@ -2326,9 +2326,9 @@ def test_a_cancelled_panel_press_does_not_suppress_the_next_focus_landing( before = page.evaluate("() => document.querySelector('.lf-threads').scrollTop") - assert ( - page.evaluate(UNDER_HEADING)["covered"] >= 20 - ), "the setup did not put the first card under its heading" + assert page.evaluate(UNDER_HEADING)["covered"] >= 20, ( + "the setup did not put the first card under its heading" + ) ``` The second hunk is the same rewrite on the `COVERED_TOP` assert at line 2344. </details> <details><summary>Third `ruff` failure on main today</summary> `lint` has gone red on four of the last twelve `ci` runs on main, each on a different `ruff` finding in the commit that had just landed: [5689178](5689178) and [ac8fe9e](ac8fe9e9) (both since fixed by later commits, closing #89 and #90), and now this one. Nothing in the repo can catch these earlier — `wt merge`'s `pre-commit` on the maintainer's machine is the only gate ahead of CI, and each of these reached main with the hook's own output unapplied. That is a local-flow observation, not something this PR changes. </details> --- Automated fix for [failed run](https://github.com/max-sixty/leaf/actions/runs/33163125560) Co-authored-by: leaf-agent <318509791+leaf-agent@users.noreply.github.com>
Problem
The
lintjob is red on main.pre-commitfails onplugins/leaf/skills/leaf/scripts/leaf/validation.py, where ruff's isort rule wantsfrom leaf import event_contractsahead offrom leaf.asks import (...)andfrom leaf.data import ...:The misordered import arrived with c4b7444, "Extract Python event contracts", and is still on main at
437cfa3. It reddenslinton every branch, not just the commit that introduced it — it is why PR #88'slintjob failed on a one-line test change.Solution
Move the import to the position ruff's autofix puts it in. This is the hook's own output, applied verbatim.
Testing
pre-commit run --all-fileson this branch: all twelve hooks pass (it fails onruff checkatorigin/main).Automated fix for failed run