31
31
32
32
# Define which languages and query packs to consider
33
33
languages = [ "actions" , "cpp" , "csharp" , "go" , "java" , "javascript" , "python" , "ruby" , "swift" ]
34
- packs = [ "code-scanning" , "security-and-quality" , "security-extended" , "security-experimental" ]
34
+ packs = [ "code-scanning" , "security-and-quality" , "security-extended" , "security-experimental" , "ccr" ]
35
35
36
36
class CodeQL :
37
37
def __init__ (self ):
@@ -169,7 +169,7 @@ def subprocess_run(cmd):
169
169
for pack in packs :
170
170
# Get absolute paths to queries in this pack by using 'codeql resolve queries'
171
171
try :
172
- queries_subp = codeql .command (["resolve" ,"queries" ,"--search-path" , codeql_search_path , "%s-%s.qls" % (lang , pack )])
172
+ queries_subp = codeql .command (["resolve" ,"queries" ,"--search-path" , codeql_search_path , "%s-%s.qls" % (lang , pack )]). strip ()
173
173
except Exception as e :
174
174
# Resolving queries might go wrong if the github/codeql repository is not
175
175
# on the search path.
@@ -183,8 +183,13 @@ def subprocess_run(cmd):
183
183
else :
184
184
sys .exit ("You can use '--ignore-missing-query-packs' to ignore this error" )
185
185
186
+ # Exception for the CCR suites, which might be empty, but must be resolvable.
187
+ if pack == 'ccr' and queries_subp == '' :
188
+ print (f'Warning: skipping empty suite ccr' , file = sys .stderr )
189
+ continue
190
+
186
191
# Investigate metadata for every query by using 'codeql resolve metadata'
187
- for queryfile in queries_subp .strip (). split ("\n " ):
192
+ for queryfile in queries_subp .split ("\n " ):
188
193
query_metadata_json = codeql .command (["resolve" ,"metadata" ,queryfile ]).strip ()
189
194
190
195
# Turn an absolute path to a query file into an nwo-prefixed path (e.g. github/codeql/java/ql/src/....)
0 commit comments