Skip to content

Reformat render_gate's split modules so ruff format passes - #90

Closed
leaf-agent wants to merge 1 commit into
mainfrom
fix/ci-33157438631
Closed

Reformat render_gate's split modules so ruff format passes#90
leaf-agent wants to merge 1 commit into
mainfrom
fix/ci-33157438631

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Problem

lint is red on main. On the assigned run (33157438631, commit f75c1f7) the failing hook was ruff check's isort rule on validation.py; that file no longer exists — 5689178 split it into a package and ruff check passes on main. What is still red is a different hook: ruff format rewrites four of the modules ac8fe9e split out of the render gate, so pre-commit reports "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, and version.py; ruff format wants two.

Solution

Run ruff format over 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_gate and each of models, preview, scheme, version — all import cleanly; the change is whitespace between definitions.
  • pytest tests --collect-only collects 654 tests with no error.

The test job'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, so test will stay red here until #88 lands.


Automated fix for failed run

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.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Superseded — closing. 43ada1a ("Extract whole-text alignment") already added exactly these seven blank lines to render_gate/models.py, preview.py, scheme.py, and version.py, so this branch's diff is now empty against main.

Verified on main at 43ada1a: ruff@0.16.1 format --check .123 files already formatted, and ruff@0.16.1 check --no-fix .All checks passed!. The lint job on main's own run for that commit (33159578982) is green.

ci is still red on main, but only on test now — tests/test_render_navigation.py::test_a_label_press_keeps_the_controls_keyboard_standing, which #88 fixes.

@leaf-agent leaf-agent closed this 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant