TODO section 24, coverage_gaps M7 via topo 2.9-6 and 2.9-4. unused-signal, undriven-net and multiply-driven shipped off because a per-file analysis cannot see a signal read or driven from another file's hierarchy. The index now carries a per-file identifier census - FileFacts::words, FACTS_FORMAT 12 -> 13, one harvest lifted from the server's completion candidates and now feeding them back from the store instead of re-lexing every file at startup (scan -28 percent) - and the linter gains a MentionOracle: unused-signal and undriven-net say nothing when the name is mentioned in any other indexed file, the false-negative-safe direction; multiply-driven shares the gate but never reads it. The three are on wherever an oracle exists (the editor always, the CLI when it walks a project) and off for a single file or stdin. With them, the missing off switch: [lint] select/ignore in lucisv.toml with CLI flags winning key by key, and lucisv.lint.select/ignore in the editor. QA's finding, reworked: the census dropped macro invocations whole, so a signal named only inside `uvm_info(..., dut.sig) was not silenced; the harvest now splits macro, directive and attribute words, skipping double-quoted runs so a "%d" cannot silence a signal named d project-wide, with workspace-defined macro names filtered out of the completion table at the reader. Store +16.9 percent corpus / +15.0 percent opentitan, measured. Corpus unused-signal 52 -> 44 and undriven-net 3 -> 0 with every silencing hand-checked, nothing added; opentitan - lint-clean under its own tools - 14 findings, all classified true against the whole repo. Also: the docs-site rules page gains the empty-item row it lacked. docs/features/semantic-lints-on/README.md. Co-Authored-By: Claude Fable 5 <[email protected]>
34 KiB
linter-core
Goal
Give lucisv a linter — the vlog_linter crate and the lucisv 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 lucisv <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 governinglucisv.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 lucisv 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/lucisv/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/lucisv: 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.LintContextgrew two methods in thesemantic-lintsround —semantics()(the file's symbol table, analyzed on first use) andwith_semantics()(a caller lending its own) — both additive;from_parse's signature did not change.semantic-lints-on(2026-09-02) addedMentionOracle,LintContext::{with_oracle, mentioned_elsewhere, has_oracle},ParsedSource::tokens(),Rule::needs_workspace(),workspace_rules()and a re-export ofvlog_semantic::words.default_rules()kept its signature and its meaning (the set for a run that cannot see other files);select_rulesgained a third parameter,workspace: bool, the round's one breaking change.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
lucisv 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 inlucisv.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. Half-delivered 2026-09-02 bysemantic-lints-on:[lint] select/ignoreinlucisv.toml(per file, CLI-over-config key by key, exactly the ladder predicted here), pluslucisv.lint.select/lucisv.lint.ignoresettings so the language server has a selection surface at all. Per-rule settings ([lint.<rule>]) are still open, and the parser now names them in its error rather than ignoring them. - 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 bothlucisv 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,lucisv: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. lucisv checkwiring,lucisv 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 inlucisv.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 lucisv cannot fully parse still gets linted for what it can see. That is also the caveat — AST-rule counts above are a lower bound.
Rules added since. The table above is this round's eight; lint-rules-2
added five naming/SV-ness rules and semantic-lints three more. The default
run's total moved to 7932 over 106 files with the naming rules. The three
semantic rules shipped off and, since semantic-lints-on (2026-09-02), are
on wherever the run can see the project:
| Rule | Default | Fix | Violations (--select, v0.29.0) |
Default run, 2026-09-02 |
|---|---|---|---|---|
unused-signal |
on (project) | — | 52 in 10 files | 44 in 7 files |
undriven-net |
on (project) | — | 3 in 2 files | 0 |
multiply-driven |
on (project) | — | 0 | 0 |
"on (project)" is Rule::needs_workspace(): the rule runs on a plain
lucisv check over more than one file, or in the language server, and stays
off for a single file or a stdin buffer. All three read the symbol table
rather than the syntax tree; the two that can be wrong about a cross-file use
also consult a MentionOracle and say nothing about a name any other file
writes down, which is what took the default-run corpus total from 55 to 44
without adding a single finding. The per-finding judgement is in
docs/features/semantic-lints/README.md; the census, the flip and the
before/after numbers are in docs/features/semantic-lints-on/README.md. The
whole-corpus default run is now 7976 over 110 files.
Waiver semantics as implemented
wire a; // lucisv: waive no-tabs suppresses that rule on this line
// lucisv: waive no-tabs alone on its line: suppresses the NEXT line
// lucisv: waive-start no-tabs ... from this line
// lucisv: waive-stop no-tabs ... through this one, both included
verilog_lint:is accepted everywherelucisv: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 (// lucisv: 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 lucisv does not implement is ignored silently; the same waiver writtenlucisv:is reported as naming an unknown rule. A codebase annotated for Verible is lintable by lucisv without editing it first, while typos in lucisv'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 / // lucisv: 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. lucisv 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.
lucisv 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/lucisv/tests/cli.rs(check_fix_rewrites_the_file_and_the_result_relints_clean).
CLI surface
lucisv check [OPTIONS] <file|dir>... lint
lucisv format [OPTIONS] <file|dir>... format (alias for the bare invocation)
lucisv [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 lucisv --check rtl/ is still the
formatter's check mode. A file named check can be formatted as
lucisv 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 lucisv.
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 concurrentlucisv_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 lucisv 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 thelucisv:spelling; averilog_lint:waiver for a rule lucisv lacks is ignored. Corpusunused-waivercount went 14 → 0, and a typo'd// lucisv: waiveis still caught. Tested bya_verible_waiver_for_a_rule_lucisv_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/lucisv/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/lucisv/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 oflucisv --checkagainstlucisv format --check). - Gates:
cargo test -p vlog_linter71+30+1 green,cargo test -p lucisv46 green,cargo clippy -p vlog_linter -p lucisv --all-targetssilent,cargo fmt --all --checkclean. The workspace has three failing tests and one clippy warning incrates/lucisv_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// lucisv: 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/lucisv/src/lint.rs(fixable_outside_fences/touches_fence), not invlog_linter—lucisvalready 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 lucisv58 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 lucisv --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/lucisv/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 lucisv: 46 green. Counts match the work log exactly.
Corpus baseline. Release build, lucisv 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 lucisv lacks>→ silent; the same spelledlucisv:→ 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 \lucisv 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 // lucisv: off fences.
crates/lucisv/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 // lucisv: off around a tab-and-trailing-whitespace line — lucisv check reports no-tabs and no-trailing-whitespace inside the
fenced region, and lucisv check --fix rewrites it, while lucisv 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 // lucisv: off
expecting hands-off code gets it silently edited by check --fix. Not
mentioned anywhere in this README (the one // lucisv: 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 lucisv --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 lucisv --check
and lucisv 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 lucisv-server (round 11). lucisv 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 lucisv lacks are ignored, not reported, because punishing them punishes exactly the vendored codebases the compatibility spelling exists to welcome — while typo'dlucisv: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
// lucisv: 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.