Add range formatting and the second lint-rule set (round 18)

range-formatting: --lines M-N[,M-N...] formats only the top-level
items intersecting the ranges; modules/packages split head/body/tail
with independent decisions, everything else is atomic, and
unselected units are emitted as merged verbatim source slices (the
run-merge is load-bearing: per-item slices let separators collapse
blank lines between untouched items). Convergence via Selection
replay -- same-selection re-runs are fixed points, sound because the
equivalence check has already proven token identity; QA's sabotage
of the replay failed immediately on real RTL. The honest limit
(same line numbers can sweep in a neighbor after lines move;
449/8236 corpus trials, all settled next run) is measured and
pinned. Fence wins over range; alignment groups split at verbatim
boundaries; cache fully bypassed; LSP rangeFormatting advertised and
consumes only lines (no UTF-16 column math); tools/vfmt-changed.sh
derives ranges from git diff. Default behavior provably unchanged
(TSV md5 + all-578-file byte-compare vs a pre-round binary).

lint-rules-2: visit.rs walks class bodies (closing the classes
handshake; +6 real findings in UVM code), five new rules with
evidence-based defaults -- parameter/enum/struct-union-name-style ON
with Verible's exact names and published defaults (vendored waivers
now honored), module-name-style OFF (Verible has no such rule; the
brief's premise was checked and corrected), wire-reg-mixup ON (0
corpus noise in .v, 209 findings on a .sv rename -- both zeroes
proven). rules_markdown() generates the rule reference; 13 rules
total, zero CLI/server wiring needed.

Also: lead notes in classes and shared-fence-filter READMEs
documenting the fence asymmetry lint-rules-2 QA found (a fence in a
class body protects fixes via the scan backstop even though the
formatter ignores it there).

768 workspace tests. Dev: 2 Opus agents; QA: 2 Sonnet agents;
reviews in docs/features/{range-formatting,lint-rules-2}/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5 committed 2026-08-19 15:28:24 -07:00
1 parent 003e0766e9
commit e9008b680c
36 files changed
+4317 -98

No files matched your search

+6 -1
View File
@@ -201,7 +201,12 @@ verbatim. The fix is one arm —
`ItemKind::Class(c) => scan_scope(src, &c.items, &c.dangling, out)` — but
`fence.rs` was explicitly outside this round's scope, so it is filed here
rather than done. Nothing is corrupted by the gap; the fence is simply
inactive.
inactive. *(Lead note, per lint-rules-2 QA: inactive for the FORMATTER
only. `fence::protected_regions`' line-based scan backstop still sees the
fence, so `vfmt check --fix` and the server's quick fixes DO decline to
edit inside it — the asymmetry errs toward hands-off, which is the
harmless direction, but readers should not conclude the fence does
nothing in a class body.)*
**Requested of `vlog_linter` (same shape, lower stakes):** `visit.rs`'s
`items()` walk has a `_ => {}` arm too, so the four **AST-walking** rules