From d18c906ca61c5b1298d2f9e626c67020345c9228 Mon Sep 17 00:00:00 2001 From: penenadpi <penenadpi@gmail.com> Date: Thu, 25 Aug 2022 04:55:26 -0400 Subject: [PATCH] Fixed .js, .html and .java file usage scenarios --- src/iac_scan_runner/compatibility.py | 4 ++++ src/iac_scan_runner/results_summary.py | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/iac_scan_runner/compatibility.py b/src/iac_scan_runner/compatibility.py index d82e897..8b52aec 100644 --- a/src/iac_scan_runner/compatibility.py +++ b/src/iac_scan_runner/compatibility.py @@ -81,6 +81,10 @@ class Compatibility: self.scanned_files["yaml"] = str(scanned_yaml) self.scanned_files["java"] = str(scanned_java) self.scanned_files["html"] = str(scanned_html) + + types = set(types) + print(types) + return types except Exception as e: raise Exception(f"Error when checking directory type: {str(e)}.") diff --git a/src/iac_scan_runner/results_summary.py b/src/iac_scan_runner/results_summary.py index 8256e61..56378cb 100644 --- a/src/iac_scan_runner/results_summary.py +++ b/src/iac_scan_runner/results_summary.py @@ -70,6 +70,30 @@ class ResultsSummary: self.outcomes[check]["status"] = "Problems" return "Problems" + if check == "htmlhint": + if outcome.find("no errors")>-1: + self.outcomes[check]["status"] = "Passed" + return "Passed" + else: + self.outcomes[check]["status"] = "Problems" + return "Problems" + + if check == "checkstyle": + if outcome == "": + self.outcomes[check]["status"] = "Passed" + return "Passed" + else: + self.outcomes[check]["status"] = "Problems" + return "Problems" + + if check == "es-lint": + if outcome == "": + self.outcomes[check]["status"] = "Passed" + return "Passed" + else: + self.outcomes[check]["status"] = "Problems" + return "Problems" + def summarize_no_files(self, check: str): """ Sets the outcome of the selected check to "no files" case -- GitLab