diff --git a/src/iac_scan_runner/compatibility.py b/src/iac_scan_runner/compatibility.py index 8b52aecff2f0c09bfcd82cb181ad91007a1ae85e..e035232d7ba2f38029aafc0d53a3304384abee4d 100644 --- a/src/iac_scan_runner/compatibility.py +++ b/src/iac_scan_runner/compatibility.py @@ -44,6 +44,7 @@ class Compatibility: scanned_yaml = [] scanned_java = [] scanned_html = [] + scanned_js = [] # TODO: List of supported file types should be extended # TODO: Remove hardcoded check names @@ -75,13 +76,18 @@ class Compatibility: types.append("html") scanned_html.append(filename) + if f.find(".js") > -1: + types.append("js") + scanned_js.append(filename) + self.scanned_files["terraform"] = str(scanned_terraform) self.scanned_files["python"] = str(scanned_py) self.scanned_files["shell"] = str(scanned_shell) self.scanned_files["yaml"] = str(scanned_yaml) self.scanned_files["java"] = str(scanned_java) self.scanned_files["html"] = str(scanned_html) - + self.scanned_files["js"] = str(scanned_js) + types = set(types) print(types) diff --git a/src/iac_scan_runner/results_summary.py b/src/iac_scan_runner/results_summary.py index 56378cbfc823cf4dbfeee86b8a86cd8fd382606a..998d687114f6bf3e5f9123f034e26c27b3d7773f 100644 --- a/src/iac_scan_runner/results_summary.py +++ b/src/iac_scan_runner/results_summary.py @@ -87,13 +87,21 @@ class ResultsSummary: return "Problems" if check == "es-lint": - if outcome == "": - self.outcomes[check]["status"] = "Passed" + if outcome.find("wrong")>-1: + self.outcomes[check]["status"] = "Problems" return "Passed" else: - self.outcomes[check]["status"] = "Problems" + self.outcomes[check]["status"] = "Passed" return "Problems" + if check == "ts-lint": + if outcome.find("wrong")>-1: + self.outcomes[check]["status"] = "Prolems" + return "Passed" + else: + self.outcomes[check]["status"] = "Passed" + return "Problems" + def summarize_no_files(self, check: str): """ Sets the outcome of the selected check to "no files" case