Reformat render_gate's split modules so ruff format passes - #90
Closed
leaf-agent wants to merge 1 commit into
Closed
Reformat render_gate's split modules so ruff format passes#90leaf-agent wants to merge 1 commit into
leaf-agent wants to merge 1 commit into
Conversation
The render gate split landed with one blank line between top-level definitions in models.py, preview.py, scheme.py, and version.py. ruff format wants two, so the lint job's ruff-format hook rewrites the files and pre-commit fails. Run ruff format over the four files.
Collaborator
Author
|
Superseded — closing. 43ada1a ("Extract whole-text alignment") already added exactly these seven blank lines to Verified on main at 43ada1a:
|
This was referenced Aug 28, 2026
max-sixty
pushed a commit
that referenced
this pull request
Aug 28, 2026
…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>
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.
Problem
lintis red on main. On the assigned run (33157438631, commit f75c1f7) the failing hook wasruff check's isort rule onvalidation.py; that file no longer exists — 5689178 split it into a package andruff checkpasses on main. What is still red is a different hook:ruff formatrewrites four of the modules ac8fe9e split out of the render gate, sopre-commitreports "files were modified by this hook" and the job fails. Both run 33158302985 (5689178) and run 33159049900 (ac8fe9e) name it.The split left one blank line between top-level definitions in
render_gate/models.py,preview.py,scheme.py, andversion.py; ruff format wants two.Solution
Run
ruff formatover the four files — seven added blank lines, no other change. That is the level the failure lives at: the hook's own output is the fix, and running the formatter rather than hand-inserting lines is what keeps the hook and the tree unable to disagree.Testing
ruff@0.16.1 format --check .→55 files already formatted(before:4 files would be reformatted).ruff@0.16.1 check --no-fix .→All checks passed!.import leaf.render_gateand each ofmodels,preview,scheme,version— all import cleanly; the change is whitespace between definitions.pytest tests --collect-onlycollects 654 tests with no error.The
testjob's failure on the assigned run is a separate, still-live problem —tests/test_render_navigation.py::test_a_label_press_keeps_the_controls_keyboard_standing, which #88 fixes. This PR does not touch it, sotestwill stay red here until #88 lands.Automated fix for failed run