Repository navigation
fix(ci): parse clang-tidy analyzer warning suffix - #2499
ankitbuilds99 wants to merge 7 commits into
Conversation
Signed-off-by: Your GitHub Username <your_email@example.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
@DeusData — this PR fixes the lint memory gate dropping clang-tidy analyzer findings with the |
|
Thanks for the focused clang-tidy suffix handling and the follow-up. I have read the regression description; this remains pending review. Since the description identifies only the diagnostic-parsing part of #2442, please use Refs rather than Closes if other work in that issue is still outstanding. |
|
Thank you for the diagnostic-suffix fix. This still needs our review; please retain a non-closing issue reference if the other parts of #2442 remain outstanding. Sorry for the delay—I’ll follow up soon. |
scripts/test.sh lists every shell contract test explicitly and does not glob tests/, so tests/test_lint_mem_gate.sh never ran on any leg. Register it as Step 0e4, next to the other gate contract (Step 0e3), in the same two-line shape as its neighbours. Step 0 runs in every default scripts/test.sh leg (macOS, Linux, Windows) and in the PR contracts-only job. The wiring, Windows included, is a maintainer decision (R1). Make the test portable to the Windows leg. There python3 is a native MSYS2 build: MSYS converts path arguments for it, but never the diagnostic text on stdin, so the absolute fixture path inside the finding does not resolve there, and a C:/ path would not parse (the file field of FINDING_RE ends at the first colon). The gate now runs from inside the fixture directory, in a subshell, with relative paths. CRLF from a native python3 is stripped from the --hash output, the whitelist is written once the hash is known (no placeholder rewrite), the gate exit status is asserted, and every failed assertion is reported together with the gate output. Refs DeusData#2442 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The test only covered a whitelisted finding. The defect in DeusData#2442 is the other direction: on main clang-tidy reported findings that carry the ,-warnings-as-errors suffix, the old FINDING_RE matched none of them, and the gate reported clean. Pin that direction too: a second fixture function with no whitelist entry, a suffixed finding inside it, and the gate must exit 1 and report the finding under its plain check name ([clang-analyzer-core.NullDereference], the whitelist key form) as an entry missing for unlisted(). With the suffix group of FINDING_RE reverted, this case exits 0 with "memory gate clean" and the test fails, naming all three assertions. A parser that accepts the line but keeps the suffix inside the check name fails it as well. The negative assertion is a maintainer decision (R1). Refs DeusData#2442 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Brings the branch up to date with main (a5b248f). No conflicts. scripts/test.sh keeps Step 0e4 next to Step 0e3; the gate script and its test are unchanged by main. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you very much, @ankitbuilds99, for tracking this down and for the clear write-up. You found the exact reason the memory-analyzer gate could report clean while clang-tidy was reporting real findings: with WarningsAsErrors enabled, the check name arrives as Maintainer edits were enabled (thank you for that), so we pushed three small commits on top of your branch to let this land now:
We also changed "Closes #2442" to "Refs #2442" in the description, because the rest of #2442 (the CI lane itself and triaging the findings it will surface) is a separate maintainer change. If you push to this branch again, please pull first so these commits are not lost. Thanks again for a precise, well-argued fix! |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thanks for your patience, @ankitbuilds99: CI went green, but another change (#2198) also edited scripts/test.sh on main in the meantime, so we merged current main into your branch once more (714a0cf, a plain signed-off merge commit, no conflicts; your change and our commits are unchanged) to let CI cover the exact tree that will merge. It merges as soon as this run is green. Please pull before pushing again. |
Summary
Refs #2442 (the clang-tidy diagnostic parsing part).
When
WarningsAsErrors: '*'is enabled, clang-tidy renders analyzer diagnostics as:The lint memory gate only accepted
[check], so it silently discarded these findings and could report a clean gate. This change accepts the optional suffix while preserving the existing whitelist key (clang-analyzer-core.NullDereference).Validation
tests/test_lint_mem_gate.shpython3 -m py_compile scripts/lint-mem-gate.pygit diff --checkThe regression test proves that a suffixed analyzer finding matches its normal whitelist entry and is counted as an argued finding.
Written with the assistance of an AI coding agent; the commit is DCO-signed by the submitting account.