mirror of
https://github.com/github/codeql.git
synced 2026-03-30 12:18:18 +02:00
Update the overlay annotation script for go
The Go libraries follow their own naming convention for "query libraries". These need to be exempted from automatic `overlay[local?]` annotations since otherwise it appears that too many predicates are evaluated, possibly because of inadequate use of sentinels.
This commit is contained in:
committed by
Owen Mansel-Chan
parent
f11815c633
commit
7ef60a8649
@@ -199,6 +199,7 @@ def annotate_as_appropriate(filename, lines):
|
||||
# as overlay[local?]. It is not clear that these heuristics are exactly what we want,
|
||||
# but they seem to work well enough for now (as determined by speed and accuracy numbers).
|
||||
if (filename.endswith("Test.qll") or
|
||||
re.search(r"go/ql/lib/semmle/go/security/[^/]+[.]qll$", filename.replace(os.sep, "/")) or
|
||||
((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and
|
||||
any("implements DataFlow::ConfigSig" in line for line in lines))):
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user