Skip to content

Commit 9b1842b

Browse files
committed
use an exclusion filter in the ModConsistency predicates (consistency query is now empty)
1 parent 1602081 commit 9b1842b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ql/ql/src/codeql_ql/ast/internal/Module.qll

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,9 +388,19 @@ module ModConsistency {
388388
not exists(mod.asModule().getAlias())
389389
) >= 2 and
390390
// paramerized modules are not treated nicely, so we ignore them here.
391-
not i.getResolvedModule().getEnclosing*().asModule().hasParameter(_, _, _)
391+
not i.getResolvedModule().getEnclosing*().asModule().hasParameter(_, _, _) and
392+
not i.getLocation()
393+
.getFile()
394+
.getAbsolutePath()
395+
.regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
392396
}
393397

394398
// not a query predicate, because this fails when running qltests, but it passes on the real thing (so it's used in EmptyConsistencies.ql)
395-
predicate noResolve(Import i) { not exists(i.getResolvedModule()) }
399+
predicate noResolve(Import i) {
400+
not exists(i.getResolvedModule()) and
401+
not i.getLocation()
402+
.getFile()
403+
.getAbsolutePath()
404+
.regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
405+
}
396406
}

0 commit comments

Comments
 (0)