@@ -20,7 +20,7 @@ def __str__(self):
2020
2121
2222class CodeQL ():
23- def __init__ (self ) -> 'CodeQL' :
23+ def __init__ (self ) -> None :
2424 codeql_result = subprocess .run (
2525 ["codeql" , "version" , "--format=json" ], capture_output = True )
2626 if not codeql_result .returncode == 0 :
@@ -36,7 +36,7 @@ def __init__(self) -> 'CodeQL':
3636 raise CodeQLError (
3737 f"Failed to retrieve codeql version information with error: { e .msg } " )
3838
39- def __build_command_options (self , ** options : Dict [ str , str ] ) -> List [str ]:
39+ def __build_command_options (self , ** options : str ) -> List [str ]:
4040 command_options = []
4141 for key , value in options .items ():
4242 command_options .append (f"--{ key .replace ('_' , '-' )} " )
@@ -59,7 +59,7 @@ def cleanup(self, database_path: Path, mode: str = "normal") -> None:
5959 raise CodeQLError (
6060 f"Unable to cleanup database { database_path } " , stdout = result .stdout , stderr = result .stderr , returncode = result .returncode )
6161
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 :
6363 database_path = database_path .resolve ()
6464
6565 command_options = self .__build_command_options (** options )
@@ -91,7 +91,7 @@ def get_qlpack(self, qlpack_path: Path) -> Any:
9191 with qlpack_path .open () as f :
9292 return yaml .safe_load (f )
9393
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 :
9595 qlpack_path = self .resolve_qlpack_path (query_path )
9696 qlpack = self .get_qlpack (qlpack_path )
9797 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[
118118 with open (temp_file ) as tmp :
119119 return csv .reader (tmp )
120120
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 :
122122 command = ['codeql' , 'generate' , 'query-help' ]
123123 options ['output' ] = str (output )
124124 options ['format' ] = format
0 commit comments