External waiver files: Verible's format from lucisv.toml, --waiver-file and the editor, union with inline waivers, honoured by quick fixes

TODO §39 (docs/features/waiver-files). Closes §4's last waiver item.

`vlog_linter::waiver_file`: `waive --rule=<rule> [--line=N|N-M]
[--location=<pattern>]`, `#` comments, BOM tolerated; `--location` is
the `--exclude` matcher (`lucisv_core::walk::is_excluded`, a new
vlog_linter → lucisv_core edge), a regex-looking pattern refused by
name. `lint_with(ctx, rules, external)` applies inline and external
waivers as a union and reports which external directives fired;
`lucisv check` reports the dead ones under `unused-waiver` at the
waiver file's line after the whole run. Discovery: `[lint] waivers`
(relative to the toml), `--waiver-file` (repeatable), `lucisv.lint.waivers`
(first workspace root); bad lines fail the CLI run with file:line and
are dropped and logged once by the server.

Review rework (QA's HIGH): the server's code-action path now lints with
the buffer's `LintRun` — its enabled rules and external waivers — so a
quick fix is never offered, nor applied by fix-on-save, for a waived
finding.

Docs: Waivers sections in README and the linter guide, cli and
configuration rows, topo edge, site rebuilt.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
lucioandClaude Fable 5.1 committed 2026-09-05 00:03:07 -05:00
1 parent f6f18de10d
commit 8a92e79fc0
44 files changed
+2257 -125

No files matched your search

+34 -2
View File
@@ -55,7 +55,39 @@ endmodule
`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.
External waiver files are not implemented in v0.41.0; the planned waiver-file
settings and CLI flag are not accepted yet.
Findings can also be suppressed from **outside** the RTL, in Verible's
waiver-file format — one directive per line, `#` comments and blank lines
ignored:
```text
# 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](/reference/rules/).
@@ -45,6 +45,7 @@ The subcommand is recognized only as the first argument. To format a file named
| `--output-format` | `text` or `json` | Select human or machine-readable diagnostics |
| `--fix` | — | Apply safe fixes and rewrite files |
| `--unsafe-fixes` | — | Allow unsafe fixes when a rule provides them |
| `--waiver-file <PATH>` | path | Read Verible-format waiver directives from this file; repeatable. Adds to `[lint] waivers` from `lucisv.toml`. Relative to the working directory. A missing file or an unparsable directive is an error (exit 2) |
| `--rules-doc` | — | Print registry-generated rule and option documentation and exit; takes no files |
Text diagnostics use `FILE:LINE:COL: severity: message [rule]`. JSON output is one array of diagnostic objects, each carrying `severity`. JSON output is lint-only; formatter errors remain text on stderr.
@@ -32,6 +32,7 @@ style_regex = "[a-z_0-9]+"
| `filelist` | string | — | EDA `.f` path | server index |
| `[lint].select` | string array | defaults | rule names or severity classes | CLI |
| `[lint].ignore` | string array | `[]` | rule names or severity classes | CLI |
| `[lint].waivers` | string array | `[]` | external waiver files, resolved against this file's directory (Verible's format; see the linter guide) | CLI and editor |
`[lint.<rule-name>]` tables configure individual rules. The rule registry
validates option names, types, bounds, and patterns; `lucisv check --rules-doc`
@@ -81,6 +82,7 @@ Unknown keys, out-of-range numbers, invalid values, tables other than `[lint]` a
| `lucisv.lint.severity.error` / `.warning` / `.style` | `true` | Enable each severity class |
| `lucisv.lint.rules.<rule>` | `default` | Override a rule with `default`, `on`, or `off` |
| `lucisv.lint.options` | `{}` | Per-rule option objects, using the same validator as project configuration |
| `lucisv.lint.waivers` | `[]` | External waiver files, absolute or relative to the first workspace folder; added to `[lint] waivers`. A missing file or a bad directive is logged once and dropped. Unused external waivers are reported by `lucisv check` only |
For formatting, project configuration wins over editor line length and
indentation, then editor tab size supplies an indent fallback, then built-in