Name the rules, say when there is nothing to say, and hold a baseline

Four things SplitLint wanted, and they build on each other.

EVERY WARNING NAMES ITS RULE, in brackets at the end the way a compiler
names the flag that produced it. Twelve rules, listed by --help. That makes
the other three possible: suppressions can name one rule and leave the line
honest about the others, the harness can assert on a rule's identity rather
than on the wording of its message, and --machine can print one tab
separated line per warning - file, line, rule, message, help - so nothing
downstream reads prose. This file's own output was parsed with regular
expressions three times in one day before it had a shape to rely on.

A CLEAN RUN SAYS SO:

  No style warnings: 121 files checked against 12 rules.

It used to exit in silence, which does not tell you it found nothing - it
tells you nothing at all, and from outside the two are identical.

A MARKER THAT SILENCES NOTHING IS ITSELF REPORTED, as dead-suppression. An
exception that outlived whatever made it necessary is the thing the
required reason exists to prevent, and naming the wrong rule now gets you
both the warning you meant to silence and a note that your suppression is
doing nothing.

AND THE CORPUS IS HELD TO A BASELINE. Sixty one warnings are left in it
deliberately and nothing stopped a sixty second. Tests/lint-baseline.txt
records how many of each rule each file should produce, so a new one fails
make test while the sixty one stay quiet; confirmed by adding an INIA 0d0
to Say.asm and watching it name the file, the rule and the count. It counts
per file and rule rather than recording line numbers, because line numbers
would churn the whole baseline whenever anything was inserted above a
warning - the same reason cycle counts are stripped from recorded output
here. ./Tests/lint.sh --bless records it again.

One thing to know for next time: the rule name was inserted before the line
number at all twenty one call sites, and the signature was changed to match
rather than the twenty one call sites being fixed. (path, rule, line) reads
no worse than (path, line, rule) and one edit has fewer ways to go wrong
than twenty one.
This commit is contained in:
Anachronaut
2026-08-26 21:00:21 -04:00
parent 9c144469b4
commit 0a2965bc63
4 changed files with 259 additions and 65 deletions
+28
View File
@@ -0,0 +1,28 @@
Programs/CosmOS/Apps/Copy.asm redundant-setd 2
Programs/CosmOS/Apps/Edit.asm redundant-setd 3
Programs/CosmOS/Apps/Wander.asm redundant-setd 1
Programs/CosmOS/Assembler/Asm.asm redundant-assignment 2
Programs/CosmOS/Assembler/Asm.asm redundant-setd 8
Programs/CosmOS/Assembler/classify.asm redundant-assignment 2
Programs/CosmOS/Assembler/classify.asm redundant-setd 6
Programs/CosmOS/Assembler/readTest.asm redundant-setd 1
Programs/CosmOS/Assembler/token.asm redundant-assignment 4
Programs/CosmOS/Assembler/token.asm redundant-setd 2
Programs/CosmOS/Assembler/tokenTest.asm redundant-setd 1
Programs/CosmOS/Source/cosmos.asm redundant-assignment 1
Programs/CosmOS/Source/cosmos.asm redundant-setd 9
Programs/CosmOS/Source/sbfs.asm branch-to-next 1
Programs/CosmOS/Source/sbfs.asm redundant-assignment 4
Programs/CosmOS/Source/sbfs.asm redundant-setd 1
Programs/CosmOS/Source/text.asm redundant-setd 2
Programs/Loader/loader.asm redundant-assignment 1
Programs/testPrograms/branchTest.asm redundant-assignment 1
Programs/testPrograms/branchTest.asm redundant-ccf 1
Programs/testPrograms/controllerWriteTest.asm branch-to-next 1
Programs/testPrograms/diagnostics/duplicateLabel.asm branch-to-next 1
Programs/testPrograms/diskTest.asm redundant-assignment 1
Programs/testPrograms/dispatchTest.asm branch-to-next 1
Programs/testPrograms/fenceTest.asm redundant-assignment 1
Programs/testPrograms/moveQTest.asm redundant-ccf 1
Programs/testPrograms/rawCallAndOffsets.asm redundant-assignment 1
Programs/testPrograms/waitTest.asm redundant-assignment 1