Skip to content
Snippets Groups Projects
Commit b1d22b19 authored by penenadpi's avatar penenadpi Committed by Anze Luzar
Browse files

Refactoring and fixing code according to review comments

parent b7667882
No related branches found
No related tags found
No related merge requests found
......@@ -155,21 +155,17 @@ class ScanRunner:
scan_output[selected_check] = check_output.to_dict()
write_string_to_file(check.name, dir_name, scan_output[check.name]["output"])
self.results_summary.summarize_outcome(selected_check, scan_output[check.name]["output"], self.compatibility_matrix.scanned_files, Compatibility.compatibility_matrix)
else:
non_compatible_checks.append(check.name)
write_string_to_file(check.name, dir_name, "No files to scan")
self.results_summary.summarize_no_files(check.name)
self.results_summary.dump_outcomes(random_uuid)
self.results_summary.generate_html_prioritized(random_uuid)
else:
for iac_check in self.iac_checks.values():
if iac_check.enabled:
check_output = iac_check.run(self.iac_dir)
scan_output[iac_check.name] = check_output.to_dict()
# TODO: Discuss the format of this output
write_string_to_file(
iac_check.name, dir_name, scan_output[iac_check.name]["output"]
......
......@@ -99,7 +99,7 @@ def write_html_to_file(file_name: str, output_value: str):
raise Exception(f"Error storing HTML to file: {str(e)}.")
def file_to_string(file_path: str):
def file_to_string(file_path: str) -> str:
"""
Reads the file given by path and returns its contents as string output
:param file_path: Path of the file
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment