Skip to content

Commit 9971398

Browse files
authored
Merge pull request #18708 from rvermeulen/rvermeulen/add-ccr-suite-to-query-list
Add CCR suite to query list
2 parents 9eeae71 + 3b87fb1 commit 9971398

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

misc/scripts/generate-code-scanning-query-list.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
# Define which languages and query packs to consider
3333
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"]
3535

3636
class CodeQL:
3737
def __init__(self):
@@ -169,7 +169,7 @@ def subprocess_run(cmd):
169169
for pack in packs:
170170
# Get absolute paths to queries in this pack by using 'codeql resolve queries'
171171
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()
173173
except Exception as e:
174174
# Resolving queries might go wrong if the github/codeql repository is not
175175
# on the search path.
@@ -183,8 +183,13 @@ def subprocess_run(cmd):
183183
else:
184184
sys.exit("You can use '--ignore-missing-query-packs' to ignore this error")
185185

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+
186191
# 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"):
188193
query_metadata_json = codeql.command(["resolve","metadata",queryfile]).strip()
189194

190195
# Turn an absolute path to a query file into an nwo-prefixed path (e.g. github/codeql/java/ql/src/....)

0 commit comments

Comments
 (0)