Files
lucisv/docs/site/src/content/docs/guides/linter.md
T
lucioandClaude Fable 5.1 4b2dad87fe One lint-configuration contract for project and editor: the server picks the editor's selection when set, else the project's, and logs rejected project entries once
TODO §42 (docs/features/lint-config-contract). Closes topo §2.9-28 and
repository-analysis finding 2.

`enabled_rules(settings, project, has_oracle)`: rung 2 is
`lucisv.lint.select` when non-empty else `[lint] select`, rung 5 the same
for `ignore` — the CLI's `pick` applied to the editor — so one buffer
linted two ways is linted the same way (asserted equal over the wire for
three configurations). `lint::project`: `ProjectLint` read from the
`Discovery` result `configured` already computes (no extra read per
pass); an unknown rule name in a project list is dropped and said rather
than silently emptying the selection. `ConfigProblems`/`ProblemLog`:
rejected `[lint.<rule>]` options, unknown names and bad `[lint] waivers`
lines are logged once per (config file, entry) in `lucisv check`'s
wording, re-armed when the config's lint content changes; the buffer
keeps linting with the entry dropped.

Docs applied: README, the linter guide, configuration.md, the analysis,
topo (28 struck; 29 filed for the editor-side unknown-name silence), site
rebuilt.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-05 01:45:48 -05:00

4.6 KiB

title, description
title description
Linter Run lucisv lint checks, select rules, apply safe fixes, configure output, and use source waivers.

The linter shares discovery, parsing, configuration, and ignore behavior with the formatter, but uses error-tolerant parsing so it can report useful findings from partially understood files.

lucisv check rtl/
lucisv check --select no-tabs,unused-signal rtl/
lucisv check --ignore module-filename rtl/
lucisv check --fix rtl/
lucisv check --output-format json rtl/

Selecting rules

--select replaces the default set with a comma-separated list. It can be repeated. --ignore then removes rules from the selected or default set. Both accept rule names and the severity classes error, warning, and style (for example, --ignore style). Both can also be written in lucisv.toml under a [lint] table (select = [...], ignore = [...]), which a command-line flag overrides key by key, and in an editor as lucisv.lint.select / lucisv.lint.ignore.

The semantic rules — unused-signal, undriven-net, multiply-driven — run by default wherever lucisv can see the other files of your project (lucisv check rtl/, or the language server), because it can then tell that another file reads a signal through a hierarchical path. Over a single file or a stdin buffer there is nothing to ask, so they are off and must be --selected.

Fixes

--fix applies safe changes and rewrites the file. Safe fixes include whitespace cleanup, posix-eof, empty-item, undersized-binary-literal, explicit-begin, suggest-parentheses, and endif-comment; the rule reference lists applicability per rule. --unsafe-fixes also permits the always-comb rewrite, whose scheduling semantics can differ from always @*. Editor quick fixes offer safe fixes only.

Fixes are sorted, overlap-checked, and filtered against format-fenced regions by the CLI and server. The reusable linter and apply_fixes API are fence-blind; callers performing automatic edits must apply that protection.

Options and diagnostics

Use [lint.<rule>] in lucisv.toml or lucisv.lint.options in the editor for per-rule options. See configuration for precedence. lucisv check --rules-doc prints all 73 registered rules, their severity, default selection, fix applicability, and option defaults.

Text output uses FILE:LINE:COL: severity: message [rule]. JSON output is one array, with a severity field on each diagnostic.

Waivers

wire a;  // lucisv: waive no-tabs
// lucisv: waive no-tabs
wire b;
// lucisv: waive-start module-name-style
module LegacyName;
endmodule
// lucisv: waive-stop module-name-style

verilog_lint: is accepted in place of lucisv: for Verible compatibility. The unused-waiver rule reports malformed, unknown, or no-longer-needed suppressions when their target rule is enabled.

Findings can also be suppressed from outside the RTL, in Verible's waiver-file format — one directive per line, # comments and blank lines ignored:

# every line of every file
waive --rule=no-tabs
# one line, or a range with both ends included
waive --rule=line-length --line=12
waive --rule=line-length --line=12-20
# only the files a pattern names
waive --rule=no-tabs --location=legacy/top.sv

--rule is required and names exactly one rule (a severity word is not accepted). --line is 1-based. --location is matched the way an --exclude pattern is — * within one path component, a pattern with / matching a path suffix, one without matching the file name at any depth — and not as a regular expression; a pattern that looks like one (.*, \., […]) is an error naming the difference.

Waiver files come from three places, and they add up: lucisv check --waiver-file <path> (repeatable, relative to the working directory), waivers under [lint] in lucisv.toml (relative to that file; read by the CLI and the editor), and the editor setting lucisv.lint.waivers (relative to the first workspace folder). External and inline waivers are a union: a finding either covers is suppressed, and one both cover leaves neither reported as dead. A missing file or an unparsable directive fails lucisv check with <file>:<line>: <message> and exit 2; in an editor the bad line is dropped and the rest of the file applies, and the bad line is written once to the lucisv log whether the file was named by the editor setting or by lucisv.toml. Unused external waivers are reported under unused-waiver at their line of the waiver file, by lucisv check only and only after the whole run.

See the complete rule reference.