@@ -20,7 +20,7 @@ def __str__(self):
20
20
21
21
22
22
class CodeQL ():
23
- def __init__ (self ) -> 'CodeQL' :
23
+ def __init__ (self ) -> None :
24
24
codeql_result = subprocess .run (
25
25
["codeql" , "version" , "--format=json" ], capture_output = True )
26
26
if not codeql_result .returncode == 0 :
@@ -36,7 +36,7 @@ def __init__(self) -> 'CodeQL':
36
36
raise CodeQLError (
37
37
f"Failed to retrieve codeql version information with error: { e .msg } " )
38
38
39
- def __build_command_options (self , ** options : Dict [ str , str ] ) -> List [str ]:
39
+ def __build_command_options (self , ** options : str ) -> List [str ]:
40
40
command_options = []
41
41
for key , value in options .items ():
42
42
command_options .append (f"--{ key .replace ('_' , '-' )} " )
@@ -59,7 +59,7 @@ def cleanup(self, database_path: Path, mode: str = "normal") -> None:
59
59
raise CodeQLError (
60
60
f"Unable to cleanup database { database_path } " , stdout = result .stdout , stderr = result .stderr , returncode = result .returncode )
61
61
62
- def run_queries (self , database_path : Path , * queries : List [ Path ] , ** options : Dict [ str , str ] ) -> None :
62
+ def run_queries (self , database_path : Path , * queries : Path , ** options : str ) -> None :
63
63
database_path = database_path .resolve ()
64
64
65
65
command_options = self .__build_command_options (** options )
@@ -91,7 +91,7 @@ def get_qlpack(self, qlpack_path: Path) -> Any:
91
91
with qlpack_path .open () as f :
92
92
return yaml .safe_load (f )
93
93
94
- def decode_results (self , database_path : Path , query_path : Path , ** options : Dict [ str , str ] ) -> Iterator :
94
+ def decode_results (self , database_path : Path , query_path : Path , ** options : str ) -> List :
95
95
qlpack_path = self .resolve_qlpack_path (query_path )
96
96
qlpack = self .get_qlpack (qlpack_path )
97
97
relative_query_path = query_path .relative_to (qlpack_path .parent )
@@ -118,7 +118,7 @@ def decode_results(self, database_path: Path, query_path: Path, **options: Dict[
118
118
with open (temp_file ) as tmp :
119
119
return csv .reader (tmp )
120
120
121
- def generate_query_help (self , query_help_path : Path , output : Path , format : str = "markdown" , ** options : Dict [ str , str ] ) -> None :
121
+ def generate_query_help (self , query_help_path : Path , output : Path , format : str = "markdown" , ** options : str ) -> None :
122
122
command = ['codeql' , 'generate' , 'query-help' ]
123
123
options ['output' ] = str (output )
124
124
options ['format' ] = format
0 commit comments