Conversation
…what it left out
A repository that has read its inventory of uncaptured columns does not
want it on every run: RefuseRadar prints 161 source-column-not-captured
lines and set 2026-10-21 to decide whether they stay. --disable RULE
(comma-separated or repeated) drops a rule's findings from the output
and from the exit code.
A filter must not make a run look cleaner than it was, so the text
output ends with what was left out ("not shown (--disable):
source-column-not-captured 161"), a run whose every finding was hidden
says "ok: nothing to report outside the disabled rules" rather than
that the files agree, and --format json keeps its array shape and puts
the same note on stderr. An unknown rule name is an error listing the
rules, not a filter that silently hides nothing; engine.Rules is that
list, and the corpus test fails if any finding's rule is missing from
it.
Disabling schema-before-connector skips the base altogether, as if
--base were not given. Filtering its findings afterwards would also
lose the columns it raised, because source-column-not-captured leaves
raised columns out of its inventory, so they would appear nowhere.
The action gains a disable input. run() now takes its output streams,
so the tests drive the real command line: hiding a rule, a disabled
error no longer failing the run, commas and repeats, an unknown name,
the base skipped, and JSON's stderr note.
…TER's In a multi-line ALTER TABLE every added column was positioned at the statement's first line, so three columns added by one migration were reported at the same line (RefuseRadar #963's three reports columns all at :6). The readers parse actions with their whitespace folded, so an action cannot be found in the file verbatim; each added column's name is now searched for in the statement text, as a whole word, after the table's name and after the previous action, and the column takes that line. When the name cannot be found the statement's line stays, as before. This is also what lets a marker on the line that adds a column refer to that column's finding. Two corpus entries change, line numbers only: diff-connector-captures- one-of-two (:5 to :7, movement_cleared_by's own line) and diff-connector-touched-other-table (three findings at :6 become :7, :8, :9, now in file order instead of message order). Every message is unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it changes
In a multi-line
ALTER TABLE, every added column was positioned at the statement's first line, so a migration adding three columns reported all three at the same line (RefuseRadar #963: threereportscolumns, all at:6). Each added column now takes its own line, in both the Postgres and the MySQL reader. This was item 6 on the roadmap.The readers parse actions with their whitespace folded, so an action cannot be found in the file verbatim. Each added column's name is searched for in the statement text instead (
ddl.NameLine): as a whole word, case-insensitively, starting after the table's name and after the previous action. When it cannot be found, the statement's line stays, as before.It is also the prerequisite for the next PR, a
cdclint:ignoremarker on the line that adds a column, which needs that column's finding to point at that line.Corpus changes (line numbers only, read line by line)
diff-connector-captures-one-of-two:5:7, wheremovement_cleared_byis addeddiff-connector-touched-other-table:6:7movement_cleared_at,:8movement_cleared_by,:9movement_clear_reasonThe second entry's findings also change order: sharing one line they were sorted by message; on their own lines they sort in file order. Every message is word for word unchanged.
Verified
ADD (a, b)list andAFTER, and names that contain the table's name (reports_noteinreports), which only a whole-word search places right.gofmt -l .clean,go vet,go test ./...pass. RefuseRadar:0 error(s), 0 warning(s), 161 info.Merging
Stacked on #19 (its commit shows in this diff until #19 merges). Merge #19, then this.