Skip to content

Add or improve existing PMD rules

David Renz edited this page May 30, 2016 · 34 revisions

If you want to add rules that work similarly to the ones we already have you will have to extend PMD itself. Those are the steps you need to do:

  1. Setup development environment
  2. Add a new rule for Apex PMD
  3. Build PMD and test your new rule
  4. Commit and Pull Request the new rule

Build PMD and test your new rule

  • Install Maven (brew install maven if you are using Homebrew)
  • To build PMD navigate to the root directory of PMD and execute mvn clean package
  • After building PMD navigate to /pmd/pmd-dist/target and unzip pmd-bin-5.5.0-SNAPSHOT.zip
  • Run PMD pmd-bin-5.5.0-SNAPSHOT/bin/run.sh pmd -d /files/to/analyse -f text -R apex-ruleset

Commit and Pull Request the new rule

  • Synchronize your workspace with your repository
  • Compare and check your changes and commit them
  • Create a pull request
Clone this wiki locally