An Imhotep plugin for PMD, the static analyzer.
PMD talk to Imhotep via the Static Analysis Results Interchange Format (sarif), which is simply a JSON with a specific schema.
- Install Imhotep itself from PyPI, since
imhotep_pmd
is merely a binding/plugin for Imhotep:pip install imhotep
- Install
imhotep_pmd
from PyPI:pip install imhotep_pmd
- Install PMD. Please refer to their website for instructions.
Unless you've unzipped the PMD archive file to ~/bin/pmd-bin-6.44.0/
, you'll have to tell imhotep_pmd
where to find the executable. This can be achieved by providing a imhotep_pmd.toml
at the root directory of the repo you want to run PMD against. The file should contain this line that specifies the command used to invoke PMD:
pmd_command = "~/bin/pmd-bin-6.44.0/bin/run.sh pmd"
To use the plugin, you'll have to pass a path to the linter in question to the imhotep runtime.
imhotep --linter imhotep_pmd.plugin:PmdLinter
Let's take #1 as an example.
$ imhotep \
--repo_name="tslmy/imhotep_pmd" \
--github-username="tslmy" \
--github-password="$GITHUB_PASSWORD" \
--pr-number=1 \
--linter imhotep_pmd.plugin:PmdLinter
Screenshots:
Before | After |
---|---|
![]() |
![]() |