mirror of
https://github.com/github/codeql.git
synced 2025-12-16 08:43:11 +01:00
Ql4Ql: Exclude files named PrintAst.qlref and qlref files that uses a query with a PrintAst name from QlRefInlineExpectations.
This commit is contained in:
@@ -64,4 +64,15 @@ class QlRefDocument extends YamlDocument {
|
||||
value = n.lookup("postprocess").(YamlSequence).getElement(_)
|
||||
)
|
||||
}
|
||||
|
||||
predicate isPrintAst() {
|
||||
this.getFile().getStem() = "PrintAst"
|
||||
or
|
||||
exists(YamlMapping n, YamlScalar value |
|
||||
n.getDocument() = this and
|
||||
value.getValue().matches("%PrintAst%")
|
||||
|
|
||||
value = n.lookup("query")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,7 @@ import ql
|
||||
import codeql_ql.ast.Yaml
|
||||
|
||||
from QlRefDocument f
|
||||
where not f.usesInlineExpectations()
|
||||
where
|
||||
not f.usesInlineExpectations() and
|
||||
not f.isPrintAst()
|
||||
select f, "Query test does not use inline test expectations."
|
||||
|
||||
Reference in New Issue
Block a user