Files
lucioandClaude Fable 5 8adb6c8ac1 Linter expansion, wave 3: the remaining nineteen Verible rules, forbidden-macro, void-cast's forbidden calls, and the e2e options case
TODO section 35 (54 -> 73 rules: every rule in Verible's published
list but forbid-implicit-declarations).
module-begin-block, legacy-generate-region, legacy-genvar-declaration,
v2001-generate-begin, explicit-function-lifetime,
explicit-task-lifetime (both exempt out-of-body definitions after a
census showed 948 of 960 findings were exactly that shape),
positive-meaning-parameter-name, suggest-parentheses (safe fix,
truth-tabled), unpacked-dimensions-range-ordering, uvm-macro-semicolon,
create-object-name-match, numeric-format-string-style,
macro-string-concatenation, disable-statement, forbidden-macro,
endif-comment (safe fix), forbid-line-continuations, dff-name-style,
proper-parameter-declaration. Verible's forbidden-symbol is the
source-file name of invalid-system-task-function (read in its
rule .cc), so it is that rule's symbols option, nothing fires twice;
void-cast gains forbidden_calls. Shared readers: walk_items_scoped,
exprs.rs, preproc.rs. A checked-in e2e case drives lucisv.lint.options
over the wire. Two rules fire on an error leaf because the parser
refuses a module-scope begin/end and a bare generate begin - filed as
docs/topo.md 2.9-25.
3 695 tests / 48 binaries; corpus 814/820 byte-identical to 0.38.0;
opentitan default-set census 1 053 -> 1 169, the arithmetic balancing
to the six default-on additions; timing unchanged.

docs/features/linter-expansion-3/README.md.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-09-04 04:55:10 -05:00

79 lines
1.9 KiB
Plaintext

#select forbidden-macro,uvm-macro-semicolon
# the default forbidden macro, and the `;` the UVM macros do not want
module m;
initial begin
`uvm_warning("A", "B")
//^ 5 forbidden-macro
`uvm_info("A", "B", UVM_LOW);
//^ 33 uvm-macro-semicolon
`uvm_error("A", "B")
end
endmodule
====
#select forbidden-macro
#options forbidden-macro.macros = ["my_macro"]
# the option replaces Verible's one-name list
module m;
initial begin
`uvm_warning("A", "B")
`my_macro(1)
//^ 5 forbidden-macro
end
endmodule
====
#select macro-string-concatenation
# `` inside a plain string is not evaluated; inside `"..."` it is
`define GLUE(a, b) $display("a``b")
//^ 31 macro-string-concatenation
`define OK(a, b) $display(`"a``b`")
module m;
endmodule
====
#select endif-comment
# a bare `endif is named by the safe fix
`ifdef SYNTHESIS
module m;
endmodule
`endif
//^ 1 endif-comment
----
`ifdef SYNTHESIS
module m;
endmodule
`endif // SYNTHESIS
//^ 1 endif-comment
====
#select endif-comment
# nesting pairs each `endif with its own condition, and a naming comment passes
`ifdef A
`ifdef B
module m;
endmodule
`endif // B
`endif
//^ 1 endif-comment
====
#select forbid-line-continuations
# a `define may be broken across lines and a string may not. The positive
# case has no marker home here: the finding lands on the *first* line of a
# multi-line string, and a marker attaches to the line above it — which is
# inside the string. Pinned in the rule's unit tests instead, as `posix-eof`
# is; what this case pins is that a multi-line macro is never reported.
`define TWO_LINES \
wire a; \
wire b;
module m;
endmodule
====
#select numeric-format-string-style
# the prefix must name the base the specifier prints
module m;
initial begin
$display("0x%0h and 'b%0b and %d", a, b, c);
$display("0x%0b", a);
//^ 15 numeric-format-string-style
$display("0d%0d", a);
//^ 15 numeric-format-string-style
end
endmodule