From 6d1dc24fa790ac279429e59ca3853b65dcbc3223 Mon Sep 17 00:00:00 2001 From: Taus Date: Sat, 19 Jun 2021 12:36:10 +0000 Subject: [PATCH] Autoformat --- ql/src/codeql_ql/ast/internal/AstNodes.qll | 4 ++-- ql/src/codeql_ql/ast/internal/Predicate.qll | 10 ++++++++-- ql/src/codeql_ql/ast/internal/Type.qll | 15 ++++++++++++--- ql/src/codeql_ql/ast/internal/Variable.qll | 2 +- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/ql/src/codeql_ql/ast/internal/AstNodes.qll b/ql/src/codeql_ql/ast/internal/AstNodes.qll index 509c11d1b79..11c45279a5e 100644 --- a/ql/src/codeql_ql/ast/internal/AstNodes.qll +++ b/ql/src/codeql_ql/ast/internal/AstNodes.qll @@ -68,8 +68,8 @@ class TBinOpExpr = TAddSubExpr or TMulDivModExpr; class TAggregate = TFullAggregate or TExprAggregate; class TExpr = - TBinOpExpr or TLiteral or TAggregate or TIdentifier or TInlineCast or - TCall or TUnaryExpr or TExprAnnotation or TDontCare or TRange or TSet or TAsExpr or TSuper; + TBinOpExpr or TLiteral or TAggregate or TIdentifier or TInlineCast or TCall or TUnaryExpr or + TExprAnnotation or TDontCare or TRange or TSet or TAsExpr or TSuper; class TCall = TPredicateCall or TMemberCall or TNoneCall or TAnyCall; diff --git a/ql/src/codeql_ql/ast/internal/Predicate.qll b/ql/src/codeql_ql/ast/internal/Predicate.qll index 330b5aef3aa..5f746237ddc 100644 --- a/ql/src/codeql_ql/ast/internal/Predicate.qll +++ b/ql/src/codeql_ql/ast/internal/Predicate.qll @@ -234,14 +234,20 @@ 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|ql-training|recorded-call-graph-metrics)/.*") + 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|ql-training|recorded-call-graph-metrics)/.*") + 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 02057d7b1af..34327b9486e 100644 --- a/ql/src/codeql_ql/ast/internal/Type.qll +++ b/ql/src/codeql_ql/ast/internal/Type.qll @@ -325,7 +325,10 @@ 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|ql-training|recorded-call-graph-metrics)/.*") + 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 +339,10 @@ module TyConsistency { query predicate varDefNoType(VarDef def) { not exists(def.getType()) and - not def.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") + not def.getLocation() + .getFile() + .getAbsolutePath() + .regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") } query predicate exprNoType(Expr e) { @@ -346,6 +352,9 @@ module TyConsistency { not exists(p.getReturnType()) ) and not e instanceof Formula and - not e.getLocation().getFile().getAbsolutePath().regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") + not e.getLocation() + .getFile() + .getAbsolutePath() + .regexpMatch(".*/(test|examples|ql-training|recorded-call-graph-metrics)/.*") } } diff --git a/ql/src/codeql_ql/ast/internal/Variable.qll b/ql/src/codeql_ql/ast/internal/Variable.qll index af3d7a9eb4c..eb3659cef7c 100644 --- a/ql/src/codeql_ql/ast/internal/Variable.qll +++ b/ql/src/codeql_ql/ast/internal/Variable.qll @@ -2,7 +2,7 @@ import ql import codeql_ql.ast.internal.AstNodes private class TScope = - TClass or TFullAggregate or TExprAggregate or TQuantifier or TSelect or TPredicate or TNewTypeBranch; + TClass or TAggregate or TQuantifier or TSelect or TPredicate or TNewTypeBranch; /** A variable scope. */ class VariableScope extends TScope, AstNode {