Autoformat

This commit is contained in:
Taus
2021-06-19 12:36:10 +00:00
committed by GitHub
parent 6bff0f48a2
commit 6d1dc24fa7
4 changed files with 23 additions and 8 deletions

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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)/.*")
}
}

View File

@@ -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 {