-
Hi, I am going trough the process of creating custom ruleset described here: https://docs.pmd-code.org/pmd-doc-6.55.0/pmd_userdocs_making_rulesets.html Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 16 replies
-
There are no default rules in PMD (some tools such as Gradle may set defaults on their own, but that's not curated by us). Having said that, you can provide multiple ruleset files to PMD, so you can provide whatever defaults you have + your custom ruleset customizing that one rule; just be mindful that the order matters (if I recall correctly, first one wins). So, if you set 2 ruleset files This is however undocumented behavior, I don't think we even print a warning for this… |
Beta Was this translation helpful? Give feedback.
Yes you can! you can have your ruleset import a complete category and exclude / configure any rules within that.
For instance this one here does exactly that, importing all existing categories (except security) and manually excluding / overriding particular rules. https://github.com/Monits/static-code-analysis-plugin/blob/staging/defaults/pmd/pmd-6.xml