mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
Python: Allow any results.bqrs file
This commit is contained in:
@@ -45,8 +45,8 @@ def parse_from_file(path: Path) -> set:
|
|||||||
return set(tuple(x) for x in raw_data["extensions"][0]["data"])
|
return set(tuple(x) for x in raw_data["extensions"][0]["data"])
|
||||||
|
|
||||||
|
|
||||||
def gather_from_mrva():
|
def gather_from_bqrs_results():
|
||||||
for f in glob.glob(f"{sys.argv[1]}/**/results/results.bqrs", recursive=True):
|
for f in glob.glob(f"{sys.argv[1]}/**/results.bqrs", recursive=True):
|
||||||
print(f"Processing {f}")
|
print(f"Processing {f}")
|
||||||
|
|
||||||
json_data = subprocess.check_output(["codeql", "bqrs", "decode", "--format=json", f])
|
json_data = subprocess.check_output(["codeql", "bqrs", "decode", "--format=json", f])
|
||||||
@@ -64,7 +64,7 @@ def gather_from_existing():
|
|||||||
pkg = f.split("/")[-1].split(".")[0][5:]
|
pkg = f.split("/")[-1].split(".")[0][5:]
|
||||||
package_data[pkg].update(all_data)
|
package_data[pkg].update(all_data)
|
||||||
|
|
||||||
gather_from_mrva()
|
gather_from_bqrs_results()
|
||||||
|
|
||||||
for pkg in package_data:
|
for pkg in package_data:
|
||||||
pkg_path = mad_path / f"auto-{pkg}.model.yml"
|
pkg_path = mad_path / f"auto-{pkg}.model.yml"
|
||||||
|
|||||||
Reference in New Issue
Block a user