Skip to content

merge: sync lava master (f9455bf) - #73

Merged
x-ror merged 5 commits into
masterfrom
sync/lava-format
Nov 18, 2026
Merged

x-ror merged 5 commits into
masterfrom
sync/lava-format

Conversation

@x-ror

@x-ror x-ror commented Nov 18, 2026

Copy link
Copy Markdown
Owner

Sync of x-ror/lava master. Lava's side is formatting only: odinfmt and clang-format with tabs and 120 columns, braces on every if, a blank line around every if (x-ror/lava#504).

How the conflicts were kept small

The first commit here formats Larva's copy of the shared code (cmd/lava, pkg/jsc, pkg/runtime, pkg/std/sqlite) with exactly Lava's tools and settings. After that, the merge's conflicts were only Larva's real changes:

  • cmd/lava/net_teardown_stress_test.odin, pkg/runtime/{eventloop/loop,globals,runtime}.odin: Larva's side, already in the new format. Lava's side there was whitespace only.
  • .clang-format, Makefile, CLAUDE.md: one configuration now. make fmt formats everything, pkg/html included, so pkg/html/odinfmt.json is gone in favour of the root one.
  • tests/mutation-manifest.json: merged by entry name. The one entry both sides changed (eval's report hook) keeps Larva's target, page.odin.

Mutation manifest

22 Larva entries whose find the formatting broke are retargeted to the same code in its new form. One of them, the dispatcher's page_runner_open, had been stale since the surface parameter landed (#67). All 368 finds now match exactly once.

Checked

make check, make build, a lava eval (nextTick, microtasks, timers, URL) and lava html --scripts --select, by hand. A second make fmt changes nothing.

No tests or gates, on the owner's instruction for this phase.

Merge with "Create a merge commit", not squash.

🤖 Generated with Claude Code

x-ror and others added 5 commits November 18, 2026 22:50
- odinfmt.json: tabs (width 4), 120 columns, sorted imports. Applied to
  cmd/lava, pkg/jsc, pkg/runtime and pkg/std/sqlite.
- .clang-format: the owner's C/C++ style with tabs (width 4) and 120 columns.
  Applied to pkg/jsc/jsc_init_windows.cpp; vendored picohttpparser opts out.
- `make fmt` runs odinfmt (when ODINFMT points at it — it ships with the OLS
  extension), strip-semicolon, then clang-format.
- CLAUDE.md §4: the formatters, and the declaration order (imports, constants,
  types, procedures), which no formatter enforces.

The same configuration Larva adopted in #71.

Formatting only. Checked: `make check` (all three targets), `make build`, a
`lava eval` touching timers, microtasks, URL and require; every
mutation-manifest `find` still matches exactly once. No tests run: paused for
this phase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The owner's rules, now in CLAUDE.md §4 and applied by `make fmt`:

- `if` always has braces, on their own lines: no `if x do y`, no `if x {y}`.
  odinfmt's convert_do (odinfmt.json) and clang-format's InsertBraces
  (.clang-format) add the braces; scripts/fmt-if.mjs spreads the one-line
  blocks odinfmt leaves behind.
- A blank line before and after every `if` statement, unless it opens or
  closes a block or a case; a comment directly above belongs to the if. No
  formatter does this, so scripts/fmt-if.mjs does. It tracks strings, comments
  and Odin's multi-line raw strings, so embedded JS in the tests is untouched.

Applied to cmd/lava, pkg/jsc, pkg/runtime and pkg/std/sqlite; `make fmt` is
stable on the result (a second run changes nothing). Nine mutation-manifest
entries pointed at `if … do` lines and were retargeted to the same code in its
new form; every find matches exactly once.

Formatting only. Checked: `make check` (all three targets), `make build`, and a
`lava eval` touching nextTick, microtasks, timers, URL, Buffer and require. No
tests run: paused for this phase.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build(fmt): format Odin and C/C++ to one style — tabs, 120 columns
Before merging x-ror/lava#504: odinfmt (Lava's odinfmt.json), clang-format and
scripts/fmt-if.mjs over cmd/lava, pkg/jsc, pkg/runtime and pkg/std/sqlite, so
the merge's conflicts are Larva's real changes and not whitespace. Formatting
only; make check passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings x-ror/lava up to f9455bf:

- 854ca75 build(fmt): braces on every if, and a blank line around every if
- 89de2df build(fmt): format Odin and C/C++ to one style — tabs, 120 columns

Formatting only on Lava's side: odinfmt + clang-format with tabs and 120
columns, braces on every if, a blank line around every if (x-ror/lava#504).

The commit before this merge formats Larva's copy of the shared code with the
same tools, so the conflicts were only Larva's real changes:

- cmd/lava/net_teardown_stress_test.odin, pkg/runtime/{eventloop/loop,globals,
  runtime}.odin: Larva's side, already in the new format; Lava's side there was
  whitespace only.
- .clang-format, Makefile, CLAUDE.md: one configuration now. `make fmt` formats
  everything, pkg/html included, so pkg/html/odinfmt.json is gone in favour of
  the root one.
- tests/mutation-manifest.json: merged by entry name. The one entry both sides
  changed (eval's report hook) keeps Larva's target, page.odin. 22 Larva
  entries whose find the formatting broke are retargeted to the same code in
  its new form, one of them (the dispatcher's page_runner_open) stale since the
  surface parameter landed. All 368 finds match exactly once.

No tests run: paused for this phase. make check, make build, a lava eval and
lava html --scripts --select checked by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@x-ror
x-ror merged commit fb5c4bb into master Nov 18, 2026
4 of 5 checks passed
@x-ror
x-ror deleted the sync/lava-format branch November 18, 2026 21:05
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