From 7321b1ce9fc09c8a084b07b609b8455a7aab579f Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Wed, 16 Mar 2022 15:49:44 -0500 Subject: [PATCH] Prioritize ignore comment over exclude dependencies --- slither/core/slither_core.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/slither/core/slither_core.py b/slither/core/slither_core.py index 98a2c24292..78ff30ca5d 100644 --- a/slither/core/slither_core.py +++ b/slither/core/slither_core.py @@ -239,14 +239,14 @@ def valid_result(self, r: Dict) -> bool: if r["elements"] and matching: return False - if r["elements"] and self._exclude_dependencies: - return not all(element["source_mapping"]["is_dependency"] for element in r["elements"]) if self._show_ignored_findings: return True - if r["id"] in self._previous_results_ids: - return False if self.has_ignore_comment(r): return False + if r["id"] in self._previous_results_ids: + return False + if r["elements"] and self._exclude_dependencies: + return not all(element["source_mapping"]["is_dependency"] for element in r["elements"]) # Conserve previous result filtering. This is conserved for compatibility, but is meant to be removed return not r["description"] in [pr["description"] for pr in self._previous_results]