From e3a4d3074c0c68e3403fd49a67b92524545700a7 Mon Sep 17 00:00:00 2001 From: Taus Date: Sat, 19 Jun 2021 11:54:50 +0000 Subject: [PATCH] Exclude a few more paths from tests --- ql/src/codeql_ql/ast/internal/Predicate.qll | 4 ++-- ql/src/codeql_ql/ast/internal/Type.qll | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ql/src/codeql_ql/ast/internal/Predicate.qll b/ql/src/codeql_ql/ast/internal/Predicate.qll index a66aa14d623..330b5aef3aa 100644 --- a/ql/src/codeql_ql/ast/internal/Predicate.qll +++ b/ql/src/codeql_ql/ast/internal/Predicate.qll @@ -234,14 +234,14 @@ private class BuiltinMember extends BuiltinPredicate, TBuiltinMember { module PredConsistency { query predicate noResolvePredicateExpr(PredicateExpr pe) { not resolvePredicateExpr(pe, _) and - not pe.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*") + not pe.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") } query predicate noResolveCall(Call c) { not resolveCall(c, _) and not c instanceof NoneCall and not c instanceof AnyCall and - not c.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*") + not c.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") } query predicate multipleResolvePredicateExpr(PredicateExpr pe, int c, ClasslessPredicate p) { diff --git a/ql/src/codeql_ql/ast/internal/Type.qll b/ql/src/codeql_ql/ast/internal/Type.qll index 216adbe89ac..02057d7b1af 100644 --- a/ql/src/codeql_ql/ast/internal/Type.qll +++ b/ql/src/codeql_ql/ast/internal/Type.qll @@ -33,7 +33,7 @@ class Type extends TType { /** * Gets a supertype of this type. This follows the user-visible type heirarchy, - * and doesn't include internal types like thecharacteristic and domain types of classes. + * and doesn't include internal types like the characteristic and domain types of classes. */ Type getASuperType() { none() } @@ -325,7 +325,7 @@ private predicate defines(FileOrModule m, string name, Type t, boolean public) { module TyConsistency { query predicate noResolve(TypeExpr te) { not resolveTypeExpr(te, _) and - not te.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*") + not te.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") } query predicate multipleResolve(TypeExpr te, int c, Type t) { @@ -336,7 +336,7 @@ module TyConsistency { query predicate varDefNoType(VarDef def) { not exists(def.getType()) and - not def.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*") + not def.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") } query predicate exprNoType(Expr e) { @@ -345,6 +345,7 @@ module TyConsistency { p = e.(Call).getTarget() and not exists(p.getReturnType()) ) and - not e.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples)/.*") + not e instanceof Formula and + not e.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") } }