Skip to content

Commit fb8f549

Browse files
authored
QL: Exclude a few more paths from tests
1 parent 76b55c4 commit fb8f549

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ private class BuiltinMember extends BuiltinPredicate, TBuiltinMember {
234234
module PredConsistency {
235235
query predicate noResolvePredicateExpr(PredicateExpr pe) {
236236
not resolvePredicateExpr(pe, _) and
237-
not pe.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*")
237+
not pe.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
238238
}
239239

240240
query predicate noResolveCall(Call c) {
241241
not resolveCall(c, _) and
242242
not c instanceof NoneCall and
243243
not c instanceof AnyCall and
244-
not c.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*")
244+
not c.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
245245
}
246246

247247
query predicate multipleResolvePredicateExpr(PredicateExpr pe, int c, ClasslessPredicate p) {

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Type extends TType {
3333

3434
/**
3535
* Gets a supertype of this type. This follows the user-visible type heirarchy,
36-
* and doesn't include internal types like thecharacteristic and domain types of classes.
36+
* and doesn't include internal types like the characteristic and domain types of classes.
3737
*/
3838
Type getASuperType() { none() }
3939

@@ -325,7 +325,7 @@ private predicate defines(FileOrModule m, string name, Type t, boolean public) {
325325
module TyConsistency {
326326
query predicate noResolve(TypeExpr te) {
327327
not resolveTypeExpr(te, _) and
328-
not te.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*")
328+
not te.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
329329
}
330330

331331
query predicate multipleResolve(TypeExpr te, int c, Type t) {
@@ -336,7 +336,7 @@ module TyConsistency {
336336

337337
query predicate varDefNoType(VarDef def) {
338338
not exists(def.getType()) and
339-
not def.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*")
339+
not def.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
340340
}
341341

342342
query predicate exprNoType(Expr e) {
@@ -345,6 +345,7 @@ module TyConsistency {
345345
p = e.(Call).getTarget() and
346346
not exists(p.getReturnType())
347347
) and
348-
not e.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*")
348+
not e instanceof Formula and
349+
not e.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*")
349350
}
350351
}

0 commit comments

Comments
 (0)