From 2979cb85ac06f1b059bbec8e90e7dbb4a6755d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= Date: Fri, 19 Apr 2024 16:34:19 -0300 Subject: [PATCH] Restore plugin example to working state The current example depended on a very old Slither version, and triggered an error due to its empty description, URL, etc. Add example values so the detector can be run. --- plugin_example/setup.py | 4 ++-- plugin_example/slither_my_plugin/detectors/__init__.py | 0 plugin_example/slither_my_plugin/detectors/example.py | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 plugin_example/slither_my_plugin/detectors/__init__.py diff --git a/plugin_example/setup.py b/plugin_example/setup.py index 1bc065394..908ad51da 100644 --- a/plugin_example/setup.py +++ b/plugin_example/setup.py @@ -1,14 +1,14 @@ from setuptools import setup, find_packages setup( - name="slither-my-plugins", + name="slither_my_plugin", description="This is an example of detectors and printers to Slither.", url="https://github.com/trailofbits/slither-plugins", author="Trail of Bits", version="0.0", packages=find_packages(), python_requires=">=3.8", - install_requires=["slither-analyzer==0.1"], + install_requires=["slither-analyzer>=0.6.0"], entry_points={ "slither_analyzer.plugin": "slither my-plugin=slither_my_plugin:make_plugin", }, diff --git a/plugin_example/slither_my_plugin/detectors/__init__.py b/plugin_example/slither_my_plugin/detectors/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/plugin_example/slither_my_plugin/detectors/example.py b/plugin_example/slither_my_plugin/detectors/example.py index 2f10cb518..edf2d382a 100644 --- a/plugin_example/slither_my_plugin/detectors/example.py +++ b/plugin_example/slither_my_plugin/detectors/example.py @@ -11,12 +11,12 @@ class Example(AbstractDetector): # pylint: disable=too-few-public-methods IMPACT = DetectorClassification.HIGH CONFIDENCE = DetectorClassification.HIGH - WIKI = "" + WIKI = "https://www.example.com/#example-detector" - WIKI_TITLE = "" - WIKI_DESCRIPTION = "" - WIKI_EXPLOIT_SCENARIO = "" - WIKI_RECOMMENDATION = "" + WIKI_TITLE = "example detector" + WIKI_DESCRIPTION = "This is an example detector that always generates a finding" + WIKI_EXPLOIT_SCENARIO = "Scenario goes here" + WIKI_RECOMMENDATION = "Customize the detector" def _detect(self):