The lint-testing backbone TODO §5 asked for. Rule tests are now .lint case files: house .cases framing plus //^ <col> <rule> markers that copy vfmt check's own diagnostics (a positioned caret was rejected -- tabs in offending lines are content, and a //-prefixed caret cannot reach columns 1-2 where no-tabs fires). Matching is exact in both directions with a readable both-named failure report. Fix cases split input from expected output and carry the cross-tool guarantee: the fixed output must be lint-clean AND formatter-convergent (sabotage- proven to reach all 5 fix cases); the #tolerant escape is empty today and enforced in both directions like #SKIP. The harness polices itself: 13 self-policing tests (12 dev + 1 lead) feed it deliberately wrong cases -- wrong columns both directions, stale markers (a renamed rule takes its markers along, proven by a live rename turning 13 cases red), unknown #select, wrong fixed output with a diff, and (lead fix per QA) a typo'd #word directive is now a loud case-file error instead of silently becoming a case name. Migration audited, not claimed: all 55 deleted test functions mapped individually onto 76 cases (58 old line-rule assertion shapes -> 76 line+col+rule cases), coverage strictly up, all 119 src unit tests untouched. vlog_formatter enters as a workspace-internal dev-only dependency (cargo tree -e normal unchanged; QA and lead ruled it a test-wiring decision, not a dependency decision). 786 workspace tests. Dev: Fable agent; QA: Opus agent; review in docs/features/lint-harness/README.md. Co-Authored-By: Claude Fable 5 <[email protected]>
80 lines
1.2 KiB
Plaintext
80 lines
1.2 KiB
Plaintext
# a tab is reported at its column
|
|
module m;
|
|
wire a;
|
|
//^ 1 no-tabs
|
|
endmodule
|
|
====
|
|
# one finding per line, at the first tab, however many tabs there are
|
|
module m;
|
|
wire a;
|
|
//^ 1 no-tabs
|
|
endmodule
|
|
====
|
|
# a tab in the middle of a line is found too
|
|
module m;
|
|
wire a;
|
|
//^ 7 no-tabs
|
|
endmodule
|
|
====
|
|
# spaces are quiet
|
|
module m;
|
|
wire a;
|
|
endmodule
|
|
====
|
|
# a tab inside a string literal is data
|
|
module m;
|
|
initial $display("a b");
|
|
endmodule
|
|
====
|
|
# waived on the same line
|
|
module m;
|
|
wire a; // vfmt: waive no-tabs
|
|
endmodule
|
|
====
|
|
# waived from the line above
|
|
module m;
|
|
// vfmt: waive no-tabs
|
|
wire a;
|
|
endmodule
|
|
====
|
|
# a waiver that waives nothing is reported
|
|
module m;
|
|
wire a; // vfmt: waive no-tabs
|
|
//^ 11 unused-waiver
|
|
endmodule
|
|
====
|
|
# fix: each tab becomes the indent width
|
|
module m;
|
|
wire a;
|
|
//^ 1 no-tabs
|
|
endmodule
|
|
----
|
|
module m;
|
|
wire a;
|
|
//^ 1 no-tabs
|
|
endmodule
|
|
====
|
|
# fix: a tab inside a string survives fixing
|
|
module m;
|
|
initial $display("a b");
|
|
//^ 1 no-tabs
|
|
endmodule
|
|
----
|
|
module m;
|
|
initial $display("a b");
|
|
//^ 1 no-tabs
|
|
endmodule
|
|
====
|
|
# fix: a tab that is also trailing whitespace takes two rounds
|
|
module m;
|
|
wire a;
|
|
//^ 1 no-tabs
|
|
//^ 9 no-trailing-whitespace
|
|
endmodule
|
|
----
|
|
module m;
|
|
wire a;
|
|
//^ 1 no-tabs
|
|
//^ 9 no-trailing-whitespace
|
|
endmodule
|