exclude tests from ql/missing-security-metadata

This commit is contained in:
Erik Krogh Kristensen
2022-03-16 10:40:45 +01:00
parent 2442beaf9a
commit d47b0a68e7

View File

@@ -41,7 +41,10 @@ predicate missingSecurityTag(QLDoc doc) {
from TopLevel t, string msg
where
t.getLocation().getFile().getBaseName().matches("%.ql") and
not t.getLocation().getFile().getRelativePath().matches(["%/experimental/%", "%/examples/%"]) and
not t.getLocation()
.getFile()
.getRelativePath()
.matches("%/" + ["experimental", "examples", "test"] + "/%") and
(
missingSecuritySeverity(t.getQLDoc()) and
msg = "This query file is missing a `@security-severity` tag."