Remove a PMD rule from a ruleset

MSAL

Removes both <rule ref="..."/> references to a rule and <exclude name="..."/> elements naming it from PMD ruleset XML files. Intended for rules that PMD deleted without offering a replacement, since PMD fails to load a ruleset that references a rule it does not know.

org.openrewrite.java.pmd.RemovePmdRule

Required

The rule to remove, either a fully qualified reference such as category/java/codestyle.xml/AvoidFinalLocalVariable or just the rule name, in which case the rule is removed regardless of which ruleset file it is referenced from.

mod run . --recipe=org.openrewrite.java.pmd.RemovePmdRule \ -P rule=category/java/codestyle.xml/AvoidFinalLocalVariable

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.