fix(sarif): register duplicate-name in the static RULES catalog#21
Merged
Conversation
The duplicate-name rule was added to checks.ts but never registered in sarif.ts RULES, so GitHub Code Scanning received a synthetic entry with just the rule ID as its short description. Add the proper entry with camelCase name and a human-readable description. Add three tests: verify the rule appears in the catalog, verify the description is not just the bare id, and verify ruleIndex resolves to the registered entry rather than a fallback.
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.
Why
The
duplicate-namerule was added tochecks.ts(shipped in v0.6) but its metadata was never registered in the staticRULEScatalog insarif.ts. When a skill set triggersduplicate-name, GitHub Code Scanning receives a synthetic fallback entry whoseshortDescriptionis just the bare rule ID ("duplicate-name"), rather than the human-readable description every other rule gets. This makes Code Scanning's rule catalog inconsistent and less useful.What
duplicate-nameentry toRULESinsrc/sarif.tswithname: "duplicateName",defaultLevel: "warning", and a clear short description.test/sarif.test.tswith three new cases:duplicate-namewhen called with no diagnostics.ruleIndexin a SARIF result forduplicate-namepoints to the registered entry, not a fallback.Tests
test/sarif.test.ts, exercising the rule catalog and ruleIndex resolution.Self-merge gate
Generated by Claude Code