Skip to content

Linter

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.

Terminal window
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/

--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.

--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.

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.

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 — a bad line in a file named by the editor setting is written once to the lucisv log, one named by lucisv.toml is not (run lucisv check to see it). 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.