scan.ignore: optional match on the finding title, to accept one check of a rule with several (e.g. the ALL CAPS title in play-metadata)

This commit is contained in:
CRTkafa 2026-10-11 18:08:11 +00:00
parent dc52eaa923
commit 43daeef97f
6 changed files with 12 additions and 7 deletions

View file

@ -149,7 +149,7 @@ export function addOriginality(r: ScanReport, o: OriginalityReport, stores: { ap
if (stores.play) r.findings.push({ ...base, guideline: 'Play: Repetitive content', store: 'play', ref: 'https://support.google.com/googleplay/android-developer/answer/9898783' });
}
for (const f of r.findings) if (f.rule === 'originality' && !f.accepted) {
const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store));
const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store) && (!i.match || f.title.toLowerCase().includes(i.match.toLowerCase())));
if (hit) f.accepted = hit.reason;
}
r.findings = sortScan(r.findings);

View file

@ -516,7 +516,7 @@ export function scanRules(inp: ScanInput): ScanFinding[] {
// ---- owner-accepted findings ----
const ignore = c?.scan?.ignore ?? [];
for (const f of out) {
const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store));
const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store) && (!i.match || f.title.toLowerCase().includes(i.match.toLowerCase())));
if (hit) f.accepted = hit.reason;
}
return sortScan(out);