Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deregister_detector #1722

Merged
merged 6 commits into from
Mar 10, 2023
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions slither/slither.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@ def register_detector(self, detector_class: Type[AbstractDetector]) -> None:
instance = detector_class(compilation_unit, self, logger_detector)
self._detectors.append(instance)

def deregister_detector(self, detector_class: Type[AbstractDetector]) -> None:
sidarth16 marked this conversation as resolved.
Show resolved Hide resolved
"""
:param detector_class: Class inheriting from `AbstractDetector`.
"""

for obj in self._detectors:
if type(obj) == detector_class: # pylint: disable=unidiomatic-typecheck
sidarth16 marked this conversation as resolved.
Show resolved Hide resolved
self._detectors.remove(obj)
return

def register_printer(self, printer_class: Type[AbstractPrinter]) -> None:
"""
:param printer_class: Class inheriting from `AbstractPrinter`.
Expand Down