Skip to content

How To: Add a post scan plugin

John M. Horan edited this page Oct 8, 2019 · 11 revisions

Introduction

Automatic vs. Manual Installation

Automatic

Some post-scan plugins are installed when ScanCode itself is installed, e.g., the License Policy plugin, whose code is located here:

https://github.com/nexB/scancode-toolkit/blob/develop/src/licensedcode/plugin_license_policy.py

These plugins do not require any additional installation steps and can be used as soon as ScanCode is up and running.

Manual

ScanCode is also designed to use post-scan plugins that must be installed separately from the installation of ScanCode. The code for this sort of plugin is located here:

https://github.com/nexB/scancode-toolkit/tree/develop/plugins

This wiki page will focus on manually-installed post-scan plugins.

Example Plugin: Hello ScanCode

To illustrate the creation of a simple post-scan plugin, we'll create a hypothetical plugin named Hello ScanCode.

  • In the /scancode-toolkit/plugins/ directory, add a folder with a relevant name, e.g., hello-scancode.
  • Inside the hello-scancode folder, add an __init__.py file. This file can be empty, and is used to indicate that the folder should be treated as a Python package directory.
    • x
  • x

[More to come.]

Clone this wiki locally