Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bc46b75

Browse filesBrowse files
committed
Address incorrect type annotations
1 parent 7272744 commit bc46b75
Copy full SHA for bc46b75

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed

‎scripts/shared/codeql.py

Copy file name to clipboardExpand all lines: scripts/shared/codeql.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __str__(self):
2020

2121

2222
class 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

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.