dynamic-types: queues ($ as an expression primary -- one grammar
addition and [$], [$:N], q[$-1] all fall out of existing machinery),
dynamic [] and wildcard [*] dims (DimKind, the round's one
non-additive AST change: three consumers, all updated), empty {}
literals, named call arguments f(.a(x)) as ExprKind::NamedArg,
case ... inside with range labels, bare @event sensitivities (also
fixing a pre-existing invented-parens refusal), and macro items
before ident-dot statements. Everything structural, nothing
verbatim; verify.rs and fence.rs byte-identical. Corpus 578 ->
636/820 formattable (70.5% -> 77.6%), parse-error 242 -> 184, 58
gained / 0 lost by path, all 636 round-tripped, all 578 previously-
formattable files byte-compared old-vs-new with zero differences.
Two newly-reachable comment drops fixed in-round (one pre-existing,
one this round's own new code -- split documented honestly post-QA).
New top blockers: interface (25), the `else head-swap (13).
one-parse: LintContext::from_parse accepts pre-built parse products
(Backing enum forced by SourceFile: !Clone; new() stays a one-line
wrapper -- all 12 rule files byte-untouched); ParsedSource::parse
lexes once; vfmt check parses once per file; the server lints from
Document's own products, eliminating the per-keystroke second parse.
Behavior identity proven at the byte level (2.4MB corpus JSON, 13
server publishes, corpus-wide --fix); check --threads 1 20% faster,
server didChange latency roughly halved. protected_regions left
alone per its documented anti-drift signature. Lead fixes on
acceptance: the from_parse contract-cost doc sentence, and a stale-
tree guard test in the server (QA's sabotage passed all 773 tests --
nothing pinned text/tree agreement; now one test does, through the
merged diagnostics path where the stale warning actually lives).
791 workspace tests. Dev: 2 Fable agents; QA: 2 Opus agents; reviews
in docs/features/{dynamic-types,one-parse}/README.md.
Co-Authored-By: Claude Fable 5 <[email protected]>
linter-core
Goal
Give vfmt a linter — the vlog_linter crate and the vfmt check subcommand —
built ruff-style from day one (a rule registry over a shared parse, violations
that may carry fixes classified safe or unsafe, --select/--ignore, JSON
output) with Verible's rule ergonomics (stable kebab-case names, a style-guide
rationale per rule, inline waivers). This round ships the engine, seven seed
rules and the CLI wiring; the rules deliberately stay syntactic, per
TODO.md §7, because semantic rules wait on vlog_semantic. The formatter is
untouched: a bare vfmt <paths> behaves exactly as it did before subcommands
existed.
Assumptions
- Tolerant parse, partial results.
LintContextparses withparse_source_tolerant, so a file the formatter would refuse is still linted. Unparsable regions becomeErrorleaves that no AST rule matches — findings from a broken file are a subset of what a fixed file would report, never a superset. Text/token rules are unaffected. - A lex error leaves no tokens. The lexer is all-or-nothing, so an unterminated block comment means no waivers are seen in that file (they live on tokens). Text rules still run. This is rare enough not to warrant a tolerant lexer.
- Waivers key on the line a diagnostic points at, not on the whole extent
of a multi-line construct. Waiving a
case-missing-defaulttherefore goes on thecaseline. case-missing-defaultflagsunique/prioritycase statements too. The qualifier is a promise to the tools, not a branch. Documented rather than configurable; a waiver is the escape hatch.always-comb-blockingonly looks atalways_comb, not atalways @*, andalways-ff-non-blockingonly atalways_ff. The SystemVerilog keywords declare intent;always @(posedge clk)does not.- Whitespace inside a string literal is data.
no-tabsandno-trailing-whitespaceneither report nor rewrite a range that touches aTokenKind::Stringspan. - A tab expands to the run's indent width (
--indent, or theindentkey of the governingvfmt.toml, default 2) — one tab, one indent level. module-filenamespeaks only for a file with exactly one top-level module, and never without a file name (stdin without--stdin-filename).- Verible waivers naming rules vfmt does not have are ignored, not reported. See Work log 2026-08-19 — this came out of the corpus baseline.
// verilog_format: offregions are reported but never auto-fixed. See "Fences" below; the linter reads fenced ranges throughvlog_formatter::fence, so what counts as fenced is the formatter's answer, widened by a conservative line scan for files that do not parse.
Handshakes
Consumed
vlog_parser:parse_source_tolerant,tokenize,LineIndex,TextRange,ast::*,token::{Token, Comment, TokenKind}. The linter reads the AST and the token stream and mutates neither. It relies on: node/Metaspans being code extents (docs/features/spans/README.md), name spans matching the text (name-spans), comments being reachable from tokens as leading/trailing trivia, andErrorleaves being opaque (error-recovery).vlog_formatter::Config: onlyindent_width, and only as the tab-expansion width. The linter does not format.vlog_formatter::fence(collect,fence_of,Fence,Regionand its fields) — read bycrates/vfmt/src/lint.rsto keep--fixout of fenced regions. All of it was alreadypub, so no visibility change was needed invlog_formatter; nothing in that crate was modified. Iffence::collectever narrows its region for the formatter's own reasons,--fixnarrows with it — that coupling is deliberate: one answer to "what is fenced", not two. Note the linter passes a tolerant tree tocollect, which handlesErrorleaves without panicking (verified live, and by the fences QA round).crates/vfmt: the walk,--exclude,.gitignoreand config discovery are reused unchanged —checkis handed the same(path, Config)job listformatbuilds, and the same worker pool.
Promised
vlog_linter's public API isRule,LintContext,Violation,Fix,Applicability,Fixed,run,lint,apply_fixes,all_rules,default_rules,rule_by_name,select_rules,UNUSED_WAIVER. Rule names are the stable part: they appear in waivers in user source, so a rename is a breaking change to other people's files.run(source, path, enabled)never panics on any input and never writes anything;LintContext::newnever fails.- Findings come back sorted by
(span.start, span.end, rule). - The exit-code contract of
vfmt checkmirrors the frozen formatter one: 0 clean, 1 violations remain, 2 error.
Requested of others (not done here)
- config-discovery's owner: a
lint = [...]/[lint]section invfmt.toml(selected rules, per-rule settings) is out of scope this round — rule selection is CLI-only (--select/--ignore). When that key lands,Options::select/ignoreshould gain the same "CLI flag > config file" precedence the formatter settings have, andselect_rulesalready takes the two lists it would feed. - whoever unifies the pipelines:
checkre-parses. TODO §4's "one parse, two tools" is not done;checkandformateach call the parser. Nothing in this crate's API prevents sharing a parse later —LintContextis the only thing that would need to accept a pre-built tree.is not doneDelivered by one-parse (round 19):LintContext::from_parseaccepts pre-built products,ParsedSource::parseis the parse-once bundle, and bothvfmt checkand the server lint from one parse — seedocs/features/one-parse/README.md.
Status / TODO
- Crate
crates/vlog_linter(deps:vlog_parser+ std only). Ruletrait:name/summary/doc/check(&LintContext).LintContext: source, tokens, tolerant AST,LineIndex,Option<PathBuf>, tab width, string-literal spans.Violation { rule, message, span, fix: Option<Fix> },Fix { edits, applicability },Applicability::{Safe, Unsafe}.apply_fixes— left-to-right, overlapping fixes skipped, all-or-nothing per fix.- Registry:
all_rules,default_rules,rule_by_name,select_rules. - Inline waivers:
waive,waive-start/waive-stop,vfmt:andverilog_lint:spellings. unused-waiverpseudo-rule (unused, unknown-rule, malformed, unmatchedwaive-stop), itself waivable and ignorable.- Seed rules:
no-tabs,no-trailing-whitespace,case-missing-default,always-ff-non-blocking,always-comb-blocking,explicit-parameter-storage-type,module-filename. vfmt checkwiring,vfmt formatalias, backward-compatible bare invocation.--output-format json,--select,--ignore,--fix,--unsafe-fixes(plumbed; no unsafe fix exists yet).- Inline-marker rule tests + CLI integration tests + corpus baseline.
--fixnever edits bytes inside a// verilog_format: offregion (QA finding, 2026-08-19).- External waiver files (
waive --rule=X --line=N --location=glob) — out of scope this round; needs a file format, a discovery rule and a precedence story against inline waivers. lintconfig key invfmt.toml— handshake above.- One parse shared by
checkandformat— handshake above. Delivered by one-parse (round 19) for the linter's consumers;formatkeeps its own strict parse by design. - Naming rules by regex,
--generate_markdownrule reference,--explain(Rule::docexists so these can be generated, but nothing generates them yet).
Rules and the corpus baseline
Run over the 860-file corpus (corpus/: ibex, opentitan, picorv32,
common_cells), read-only, 0.09 s wall on 10 cores:
| Rule | Fix | Violations | Files |
|---|---|---|---|
no-tabs |
Safe | 7527 | 45 |
explicit-parameter-storage-type |
— | 107 | 51 |
no-trailing-whitespace |
Safe | 85 | 7 |
case-missing-default |
— | 66 | 22 |
module-filename |
— | 17 | 17 |
always-ff-non-blocking |
— | 4 | 1 |
always-comb-blocking |
— | 0 | 0 |
unused-waiver |
— | 0 | 0 |
| total | 7806 | 93 |
Honest reading of that table:
no-tabsdominates exactly as expected, and it is concentrated, not spread: 2590 of the 7527 are one file (picorv32/picorv32.v), and 45 of 860 files account for all of them.--fixclears the whole category.always-comb-blockingscoring zero is not suspicious —<=in analways_combis a real bug, and this corpus is good code.unused-waiverscored 14 before the Verible-spelling decision below and 0 after; every one was// verilog_lint: waive macro-name-stylein ibex's vendored lowRISC code.- No file errored: the tolerant parse means even the 40 % of the corpus vfmt cannot fully parse still gets linted for what it can see. That is also the caveat — AST-rule counts above are a lower bound.
Waiver semantics as implemented
wire a; // vfmt: waive no-tabs suppresses that rule on this line
// vfmt: waive no-tabs alone on its line: suppresses the NEXT line
// vfmt: waive-start no-tabs ... from this line
// vfmt: waive-stop no-tabs ... through this one, both included
verilog_lint:is accepted everywherevfmt:is.- Exactly one rule name per waiver; anything else is
unused-waiver: malformed. A comment that does not start with one of the two prefixes plus awaive*keyword is an ordinary comment (// vfmt: offstays a format fence). - Ranges nest per rule; the innermost open
waive-startfor a rule is what awaive-stopcloses. An unclosedwaive-startruns to the end of the file (the format fences' rule). Awaive-stopwith nothing open is reported. - A waiver whose rule this run did not enable is silent — with
--select no-tabs, waivers for other rules are not "unused", they simply had no chance to fire. - A
verilog_lint:waiver naming a rule vfmt does not implement is ignored silently; the same waiver writtenvfmt:is reported as naming an unknown rule. A codebase annotated for Verible is lintable by vfmt without editing it first, while typos in vfmt's own waivers still surface. unused-waiverfindings can themselves be waived, and the derivation loops until the used-set stops growing so waiving one does not leave the waiver that did it reported as unused.- External waiver files are not implemented.
Fences: reported, never auto-fixed
A // verilog_format: off / // vfmt: off region is emitted by the formatter
as the exact source bytes it was written with — hand-aligned tables are the
reason the fence exists. vfmt check therefore reports violations inside a
fenced region (a finding is information, and --select/--ignore/waivers are
the ways to silence one) but never fixes them: --fix drops any fix whose
edits intersect a fenced range, leaving those violations reported and the exit
code at 1. "Off" means hands-off for both tools, not just the formatter.
Fenced ranges come from two sources, unioned:
vlog_formatter::fence::collect— the formatter's own item-scoped answer, authoritative wherever the tree is good. The protected range is the wholeRegion::start .. Region::endthe formatter would emit verbatim, the fence line's own indentation included.- A line scan using
fence::fence_of(the same grammar), pairing eachoffwith the nextonor the end of the file. This is the backstop for the files only the linter sees: error recovery can swallow the item structure a region hangs on, andcollectthen reports nothing at all — measured, not assumed. It can protect slightly more than the formatter emits verbatim, and would be fooled by a fence spelled inside a block comment; both err toward declining a fix, which is the harmless direction.
An insertion (an empty edit range) inside a region is blocked too, so nothing can be spliced in. A fix is all-or-nothing, so one edit landing inside a fence blocks that whole fix — never half of it.
Fix model
ruff's, verbatim in spirit:
Fix { edits: Vec<(TextRange, String)>, applicability: Safe | Unsafe }. Safe = cannot change what the code means (whitespace); Unsafe = may.--fixapplies Safe fixes;--unsafe-fixes(with--fix) widens to both. No rule ships an Unsafe fix yet — the flag is plumbed and tested so the first one does not have to touch the CLI.always-*-blockingare the obvious candidates and were deliberately left fixless: swapping=for<=changes the circuit.- A fix is all-or-nothing; its edits are applied together or not at all.
- Within one pass, a fix overlapping one already applied is skipped rather
than merged, so a pass can never garble text.
vfmt check --fixtherefore loops (fix → re-lint) until nothing changes, capped at 10 rounds. The everyday case needing two rounds is a line ending in a tab:no-tabsandno-trailing-whitespaceboth want those bytes. - A fix inside a
// verilog_format: offregion is never applied — see Fences above. - Fixed output re-lints clean for the fixed rules — asserted in
crates/vlog_linter/src/lib.rs(fixing_leaves_the_file_clean_for_the_fixed_rules) and end to end incrates/vfmt/tests/cli.rs(check_fix_rewrites_the_file_and_the_result_relints_clean).
CLI surface
vfmt check [OPTIONS] <file|dir>... lint
vfmt format [OPTIONS] <file|dir>... format (alias for the bare invocation)
vfmt [OPTIONS] <file|dir>... format — unchanged
The subcommand word is read only as the first argument. Everything else is
inputs and flags exactly as before, so vfmt --check rtl/ is still the
formatter's check mode. A file named check can be formatted as
vfmt format check.
check-only flags: --select RULES, --ignore RULES (comma-separated,
repeatable), --output-format text|json, --fix, --unsafe-fixes. Using one
of them without check is an error, as is --check/--diff/--stdout with
it. --indent, --exclude, --threads, --no-config, --no-gitignore,
--stdin-filename and - work for both.
Text output is Verible's line, sorted by file then position:
rtl/bar.sv:2:1: tab character; indent with spaces [no-tabs]
JSON is one array on stdout (errors stay on stderr, so the array is always parsable), each element:
{"filename":"rtl/bar.sv","rule":"no-tabs","message":"...",
"location":{"line":2,"column":1},"end_location":{"line":2,"column":2},
"range":{"start":11,"end":12},
"fix":{"applicability":"safe","edits":[{"start":11,"end":12,"content":" "}]}}
fix is null when the rule offers none. Serialization is hand-rolled (~30
lines): the shape is three fields deep, and no serialization crate is a
dependency of this crate or of vfmt.
Exit codes: 0 clean (or everything fixed), 1 violations remain, 2 error (bad arguments, unknown rule, unreadable file). An error outranks violations, as in the formatter.
Work log
2026-08-19 — dev
- Created
crates/vlog_linter(files first, workspace member after — the ordering that bit a previous round) withvlog_parser+ std only. Addedcrates/vlog_linterto the rootmemberslist additively, leaving the concurrentvfmt_serverentries and workspace deps untouched. - Modules:
violation(Violation/Fix/Applicability/apply_fixes),context(LintContext),visit(item/statement walks),registry(Rule trait + tables + selection),waiver,rules/(one file per rule). - Design decisions
all_rules()returnsVec<&'static dyn Rule>over unit structs. Boring, no macro, no inventory crate; the cost is oneVecallocation per call.unused-waiveris a registry entry with an emptycheckrather than a special case outside the rule set. That way--select/--ignore, waivers and the rule reference all treat it like any other rule; the findings come from the waiver engine.- One
no-tabsfinding per line, not per tab, with the fix covering every tab on that line — otherwise a tab-indented file reports thousands of identical diagnostics (picorv32.v alone would have been far noisier). - The tab-expansion width is
Config::indent_width, so--indent 4fixes tabs to four spaces. This is the only thing the linter takes from the formatter's config. - Rules skip ranges touching a string literal. Rewriting a tab inside
"a\tb"would change data, which no "safe" fix may do. apply_fixesskips overlapping fixes instead of trying to merge them, and the CLI loops. Simpler to reason about and provably non-garbling.
- Corpus finding that changed a decision. The first baseline reported 14
unused-waiverviolations, all of them// verilog_lint: waive macro-name-stylein vendored lowRISC code — i.e. correct Verible waivers for a rule vfmt has not implemented. Reporting those punishes exactly the codebases theverilog_lint:spelling exists to welcome. Changed so that an unknown rule name is reported only for thevfmt:spelling; averilog_lint:waiver for a rule vfmt lacks is ignored. Corpusunused-waivercount went 14 → 0, and a typo'd// vfmt: waiveis still caught. Tested bya_verible_waiver_for_a_rule_vfmt_does_not_have_is_ignored. - CLI:
args.rsgainedCommand/OutputFormat, the five check-only flags and a scope check that rejects a flag used with the wrong tool; the subcommand is only read as the first argument, which is what keeps every old command line meaning what it did. Newcrates/vfmt/src/lint.rsholds the check driver and reusesgather,build_poolandcatch_panicfrommain.rs. - Tests: 71 unit + 30 inline-marker integration tests in
vlog_linter; 16 new CLI tests incrates/vfmt/tests/cli.rs(exit codes, JSON shape,--fixround trip in a temp dir, waivers, stdin, walk reuse, and four backward-compatibility tests including a byte-for-byte comparison ofvfmt --checkagainstvfmt format --check). - Gates:
cargo test -p vlog_linter71+30+1 green,cargo test -p vfmt46 green,cargo clippy -p vlog_linter -p vfmt --all-targetssilent,cargo fmt --all --checkclean. The workspace has three failing tests and one clippy warning incrates/vfmt_server, which belongs to another agent's concurrent round and does not depend on this crate. - TODO.md §4: checked the rule trait/registry item, the diagnostic-format +
JSON item, the fix-applicability item, the waiver item (with the external
waiver files caveat spelled out) and the seed-rules item. Left "one parse,
two tools", naming rules and
--generate_markdownunchecked.
2026-08-19 — dev (QA follow-up)
- QA should-fix:
--fixrewrote bytes inside// vfmt: offfences. Fixed per the lead's ruling: violations inside a fenced region are still reported, but no fix that touches those bytes is applied. Implemented incrates/vfmt/src/lint.rs(fixable_outside_fences/touches_fence), not invlog_linter—vfmtalready depends onvlog_formatter, and doing it here keeps the linter crate's dependency list atvlog_parser+ std, which is the property QA verified withcargo tree. - No visibility change was needed.
fence::{collect, fence_of, Fence, Region}andRegion's fields are alreadypub;crates/vlog_formatterwas not modified at all. The lead's authorization went unused. - Verified the tolerant-parse question rather than assuming it.
fence::collecttakes the tolerant tree without panicking, as expected — but on a file with a parse error before the fence, error recovery swallows the item structure the region hangs on andcollectreturns no region, so the first implementation still rewrote fenced bytes in exactly the files only the linter sees. Added a second source: a line scan built onfence::fence_of(the formatter's own grammar, so the fence spelling is not duplicated), pairingoffwith the nextonor EOF. The two are unioned; the scan can protect marginally more than the formatter emits verbatim, which only ever declines a fix. - The protected range is
Region::start..Region::end— the whole byte range the formatter emits verbatim, notregion_at'sfence..end— so the fence line's own indentation is protected too. Empty (insertion) edit ranges are treated as covering the byte they precede, so nothing can be spliced in. - Tests: the QA repro as a CLI test
(
check_reports_inside_a_fence_but_never_fixes_there: fenced line byte-identical including tab and trailing run, unfenced line still fixed, exit 1, and the two surviving findings both point into the fence),a_fence_holds_even_in_a_file_that_does_not_parse(which also re-asserts the formatter still exits 2 on it), plus six unit tests inlint.rscovering the boundary cases the lead asked for — first byte inside, last byte inside, adjacent-outside at both ends, straddling either edge, insertions, multi-edit fixes, unclosed fences and non-fence comments. - Corpus baseline re-run after the change: 7806 violations over 93 files, per-rule counts byte-identical to the table above (the corpus contains no fences, so the filter is a no-op there — confirmed, not assumed).
- Gates after the change:
cargo test -p vlog_linter71+30+1,cargo test -p vfmt58 unit + 48 CLI, workspace green, clippy silent, fmt clean.
QA log
2026-08-19 — QA
Verified every claim in this README against the code, the gates, and a live corpus run. All PASS unless noted; one should-fix finding below.
Gates. cargo tree -p vlog_linter: only vlog_parser (+ std),
matching the dependency claim. cargo fmt --all --check clean.
cargo clippy -p vlog_linter -p vfmt --all-targets silent on a forced
rebuild (touched lib.rs first to rule out a stale cache). No unsafe,
no #[allow], and every .unwrap()/.expect() in the crate is inside a
#[cfg(test)] module (checked crates/vlog_linter/src/** and
crates/vfmt/src/lint.rs by hand) — CLAUDE.md's Rust standards hold.
cargo test -p vlog_linter: 71 unit + 30 integration + 1 doctest, green.
cargo test -p vfmt: 46 green. Counts match the work log exactly.
Corpus baseline. Release build, vfmt check corpus/ --output-format json: 7806 violations over 93 files, byte-identical across
repeated runs and across --threads 1 vs the default pool (fully
deterministic). Per-rule breakdown parsed from the JSON matches the
table exactly: no-tabs 7527/45, explicit-parameter-storage-type 107/51,
no-trailing-whitespace 85/7, case-missing-default 66/22,
module-filename 17/17, always-ff-non-blocking 4/1,
always-comb-blocking 0/0, unused-waiver 0/0. Wall time on this machine
was ~0.26s (vs. the documented 0.09s/10-cores) — different hardware, not
a discrepancy; determinism and counts are what matter and both check out.
Rule attacks (crafted probes, not just the corpus). All PASS:
no-tabs: a tab inside a string is neither reported nor fixed; a tab inside a comment is still reported (README only exempts string literals — code and doc agree).case-missing-default: fires on plaincase,casez,priority case; silent when adefaultexists (includingunique case); fires on generatecase; acaseznested inside analways_combinside a generatebeginblock is reached and flagged correctly.always-ff-non-blocking/always-comb-blocking: correctly flag a blocking/non-blocking assignment 3beginlevels deep; afor-loop header'si++/init is not mistaken for a flagged assignment, while a real assignment inside the loop body is still caught; reached through nestedgenerate ifblocks.explicit-parameter-storage-type:parameter type T = intand a packed-dims-onlyparameter [7:0] Aare both handled as documented (the former clean, the latter flagged).module-filename: silent on a two-module file, silent on stdin with no--stdin-filename, and a case-mismatch (Foo.svvsmodule foo) is flagged — reasonable default, not previously spelled out in the README but not a bug.- An all-garbage file (no valid tokens/syntax) and a file with an unterminated block comment (lex failure) both lint without panicking; the garbage file still catches a stray tab via the text rule.
Waiver attacks. All PASS, including the trickier ones:
- Two nested
waive-start no-tabsfollowed by twowaive-stop no-tabs: the first stop closes the inner range, the second closes the outer one, and a line covered only by the outer range (between the two stops) stays suppressed — matches "innermost open start is what a stop closes." waive-stopwith no matching start → reported, message contains "no matching".- A waiver for a rule dropped by
--ignoreis silent (0 findings, exit 0) — confirmed with--ignore no-tabs --select no-tabs,unused-waiver. verilog_lint: waive <rule vfmt lacks>→ silent; the same spelledvfmt:→ reported unknown-rule. Both confirmed live via the CLI, not just the unit tests.unused-waiverwaiving itself → no findings at all (fixed-point derivation works).--select unused-waiveralone still catches an unknown-rule waiver with no other rules running.
Fix engine. All PASS:
- A line with a tab that is also trailing whitespace (
\twire a;\t\n) needs the documented two rounds;--fixconverges and the result relints clean forno-tabs/no-trailing-whitespace. --fixon a file that also has an unfixable violation (module-filename) fixes what it can, leaves the rest reported, exits 1.check --fix --checkis rejected (--check is not valid for \vfmt check`), confirming--check` stays a formatter-only flag.- A second
--fixrun on an already-fixed-as-far-as-possible file is a no-op for fixing (0 additional applied) and exit code reflects only the remaining unfixable violation. - No rule in
crates/vlog_linter/src/rules/*.rscallsFix::unsafe_fix/usesApplicability::Unsafe— confirmed by grep — so--unsafe-fixeschanging nothing today is accurate, not just claimed.
Should-fix finding — --fix does not respect // vfmt: off fences.
crates/vfmt/src/lint.rs (run_rules/fix_source) builds a
LintContext straight from the raw source and never consults
fence.rs; crate::vlog_linter has no notion of fences at all (its
Cargo.toml doesn't even depend on vlog_formatter beyond the
Config::indent_width handshake noted in this README). Repro: a file
with // vfmt: off around a tab-and-trailing-whitespace line — vfmt check reports no-tabs and no-trailing-whitespace inside the
fenced region, and vfmt check --fix rewrites it, while vfmt format
(the formatter) leaves the same region byte-for-byte untouched by
design. This does not corrupt code (the rewrite is a Safe,
meaning-preserving one) and does not break any hard invariant, but it
violates the fence's whole premise — a user who wrote // vfmt: off
expecting hands-off code gets it silently edited by check --fix. Not
mentioned anywhere in this README (the one // vfmt: off reference,
lines 162–163, only says the waiver parser treats it as an ordinary
comment, which is correct and unrelated to this). Recommend either (a)
LintContext/the fix/report path skip fenced ranges, matching the
formatter's contract, or (b) if the fenceless behavior is intentional,
document it explicitly in Assumptions and the CLI surface section so
users aren't surprised. Left unfixed by me — this is a design decision,
not a typo, and out of my QA-log-only write scope.
JSON. Valid per python3 -c json.load on every run above, including
a path with non-ASCII characters, embedded double quotes, and a space
in a directory name — round-tripped correctly. Empty-array case ([])
confirmed on a clean file, exit 0.
Backward compatibility. Built the pre-round binary from a git worktree at HEAD (1ac9746, before this round's uncommitted changes)
and compared vfmt --check over the full corpus against the new
binary: stdout byte-identical, stderr byte-identical (including the
same 359 parse-error lines and the same "488 files would be
reformatted, 13 files left unchanged, 359 files failed to format"
summary), same exit code (2). Also reconfirmed live that vfmt --check
and vfmt format --check are byte-identical on the new binary. The
linter changes did not perturb the formatter at all, as the README
promises.
CLAUDE.md / TODO.md honesty. git diff HEAD -- TODO.md shows §4's
sub-items checked/unchecked exactly as the work log claims: rule
trait/registry, diagnostic format, fix-applicability and the inline-
waiver sub-item are checked; the external-waiver-files sub-item, the
wire/reg-mixup sub-item, and "one parse, two tools" are left unchecked
with explanatory → notes rather than silently marked done. Top-level
README.md's new Linting section matches this feature README's
behavior exactly, including the --unsafe-fixes "changes nothing yet"
caveat and the external-waiver-files gap. No files outside
crates/vlog_linter, the CLI wiring named in the task, and this QA log
were touched.
Verdict. No BLOCKING findings — no rule false-positive/negative on
any of the attacked shapes, no --fix corruption, no backward-compat
break. One should-fix finding (fences vs. --fix, above).
Review
2026-08-19 — lead. Verdict: accepted after one directed fix; commits
jointly with vfmt-server (round 11). vfmt check completes the ruff
analog.
Points reviewed and accepted:
- The Verible-waiver asymmetry is the round's best judgment call:
verilog_lint:waivers naming rules vfmt lacks are ignored, not reported, because punishing them punishes exactly the vendored codebases the compatibility spelling exists to welcome — while typo'dvfmt:waivers still get caught. A design decision changed by corpus evidence, recorded with the evidence. - The fix engine's conservatism (Safe/Unsafe from day one,
overlaps skipped not merged, fix→re-lint loop with a cap,
always-*-blockingdeliberately fixless because swapping=/<=changes the circuit) is the right posture for a tool whose sibling formatter promises never to corrupt. - The fence ruling (violations reported inside
// vfmt: off, fixes never applied there) was implemented better than directed: the dev discovered thatfence::collectyields no regions on files with a parse error before the fence — exactly the tolerant-parse population only the linter sees — and built a union of the authoritative tree regions and a scan backstop sharing the formatter's ownfence_ofgrammar, so the spelling can't drift. Erring toward protecting more than the formatter emits verbatim only ever declines a fix. Verified by the boundary test matrix and a live lead probe (fenced bytes byte-identical, unfenced fix applied, exit 1). - Backward compatibility proven at the byte level against a HEAD worktree binary, and the corpus baseline (7806/93) reproduced deterministically before and after the fence fix.
Honest remainders stay on TODO §4: external waiver files, naming rules, markdown rule docs, wire/reg mixup (needs a SystemVerilog-ness decision), and one-parse-two-tools (check re-parses today; only LintContext changes when unified). The LSP server should surface lint diagnostics in a future round — filed there as a natural follow-up.