Skip to content

Commit c91e61e

Browse files
jbjowen-mc
authored andcommitted
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.
1 parent ab54b54 commit c91e61e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

config/add-overlay-annotations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def annotate_as_appropriate(filename, lines):
199199
# as overlay[local?]. It is not clear that these heuristics are exactly what we want,
200200
# but they seem to work well enough for now (as determined by speed and accuracy numbers).
201201
if (filename.endswith("Test.qll") or
202+
re.search(r"go/ql/lib/semmle/go/security/[^/]+[.]qll$", filename.replace(os.sep, "/")) or
202203
((filename.endswith("Query.qll") or filename.endswith("Config.qll")) and
203204
any("implements DataFlow::ConfigSig" in line for line in lines))):
204205
return None

0 commit comments

Comments
 (0)