Skip to content

fix(sarif): register duplicate-name in the static RULES catalog#21

Merged
protosphinx merged 1 commit into
mainfrom
bot/sarif-duplicate-name-rule
May 25, 2026
Merged

fix(sarif): register duplicate-name in the static RULES catalog#21
protosphinx merged 1 commit into
mainfrom
bot/sarif-duplicate-name-rule

Conversation

@protosphinx
Copy link
Copy Markdown
Member

Why

The duplicate-name rule was added to checks.ts (shipped in v0.6) but its metadata was never registered in the static RULES catalog in sarif.ts. When a skill set triggers duplicate-name, GitHub Code Scanning receives a synthetic fallback entry whose shortDescription is 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

  • Add a proper duplicate-name entry to RULES in src/sarif.ts with name: "duplicateName", defaultLevel: "warning", and a clear short description.
  • Extend test/sarif.test.ts with three new cases:
    • The rule catalog includes duplicate-name when called with no diagnostics.
    • The registered description is not just the bare rule ID (guards against future regressions to synthetic fallback).
    • ruleIndex in a SARIF result for duplicate-name points to the registered entry, not a fallback.

Tests

  • All 91 existing tests continue to pass.
  • 3 new tests added in test/sarif.test.ts, exercising the rule catalog and ruleIndex resolution.

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (added + removed)
  • no public-API surface change
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended

Generated by Claude Code

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.
@protosphinx protosphinx added the automated Opened by the daily bot label May 25, 2026 — with Claude
@protosphinx protosphinx merged commit 7ba3209 into main May 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant