mirror of
https://github.com/github/codeql.git
synced 2026-04-20 22:44:52 +02:00
Merge pull request #19104 from michaelnebel/ql4ql/excludeprintastinlineexpect
QL4QL: Exclude PrintAst like tests from being reported as having missing InlineExpectations.
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."
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
| |
|
||||
@@ -0,0 +1 @@
|
||||
dummy/PrintAst.ql
|
||||
@@ -0,0 +1 @@
|
||||
| |
|
||||
@@ -0,0 +1 @@
|
||||
query: dummy/PrintAst.ql
|
||||
@@ -0,0 +1 @@
|
||||
| |
|
||||
@@ -0,0 +1 @@
|
||||
select ""
|
||||
Reference in New Issue
Block a user