Fix: file-scoped wildcard ignores suppress non-value-bearing rules (#296) (#309)

A file-scoped wildcard ignore (add-value <rule> "*" --file <glob>) silently no-op'd for rules with no extractable value, such as side-tab. isIgnoredFindingValue bailed on an empty value before the wildcard/file-scope branch could run.

Require a value only on the specific-value path; let the scoped wildcard match on rule + file. Mirrored in skill/scripts/hook-lib.mjs for CLI/hook parity.
This commit is contained in:
Abdul Wahab
2026-07-07 17:23:39 -07:00
committed by GitHub
parent a99bb976b7
commit ca121aa35f
4 changed files with 63 additions and 4 deletions
+4 -2
View File
@@ -711,11 +711,13 @@ export function filterFindings(findings, _content, _ext, config) {
function isIgnoredFindingValue(finding, ignoreValues) {
if (!Array.isArray(ignoreValues) || ignoreValues.length === 0) return false;
const rule = normalizeIgnoreRule(finding.antipattern);
if (!rule) return false;
// File-scoped wildcards suppress rules with no extractable value, such as side-tab.
const value = extractFindingIgnoreValue(finding);
if (!rule || !value) return false;
return ignoreValues.some((entry) => {
if (entry.rule !== rule) return false;
const wildcardValue = entry.value === '*';
if (entry.rule !== rule || (!wildcardValue && !ignoreValueMatches(rule, entry.value, value))) return false;
if (!wildcardValue && (!value || !ignoreValueMatches(rule, entry.value, value))) return false;
if (!Array.isArray(entry.files) || entry.files.length === 0) return !wildcardValue;
return findingMatchesScopedIgnoreFile(finding, entry.files);
});