fix checkRulesCoverage (#158)

unknown rule: don't throw exception, just add to report (once)
This commit is contained in:
Dror Tirosh
2023-11-13 16:39:28 +02:00
committed by GitHub
parent 09056eb560
commit 436f12241b

View File

@@ -47,9 +47,10 @@ rules["STO-000"] = "== placehodler rule";
function foundRule(r) {
if (r.match(/UTF|eip|erc|gpl/i)) return ;
if ( !rules[r])
throw new Error(`unknown referenced rule ${r}`)
if ( unmatched[r]) {
if ( !rules[r]) {
console.log("UNKNOWN:", r)
rules[r] = "==unknown=="
} else if ( unmatched[r]) {
if ( showMatch )
console.log("matched:",r) // ${rules[r]})
totMatched++;