blob: 80e52daf801ce3dffa3b60732804f8291f37d41d [file] [log] [blame]
<?xml version="1.0"?>
<ruleset name="buck"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Rules for the Buck project.</description>
<!--
Visit https://github.com/pmd/pmd/tree/master/pmd-java/src/main/resources/rulesets/java
for ruleset definitions. Note that Buck is currently built with PMD 5.0.3.
-->
<rule ref="rulesets/java/basic.xml" />
<rule ref="rulesets/java/empty.xml" />
<rule ref="rulesets/java/imports.xml">
<!--
Excluded because tests that use both JUnit and EasyMock tend to
statically import many methods, which we allow.
-->
<exclude name="TooManyStaticImports" />
</rule>
<rule ref="rulesets/java/coupling.xml/LooseCoupling" />
<rule ref="rulesets/java/junit.xml">
<!-- This is not practical. -->
<exclude name="JUnitAssertionsShouldIncludeMessage" />
<!-- Unclear what an appropriate upper bound would be. -->
<exclude name="JUnitTestContainsTooManyAsserts" />
<!--
Not practical: pure EasyMock tests or tests that exclusively assert
using MoreAsserts.* should not need to be annotated with this.
-->
<exclude name="JUnitTestsShouldIncludeAssert" />
</rule>
<rule ref="rulesets/java/unusedcode.xml">
<!--
Including the public keyword in interface methods is acceptable: this
makes it easier to copy/paste them.
-->
<exclude name="UnusedModifier" />
<!-- This rule is buggy (http://sourceforge.net/p/pmd/bugs/792/ and others). -->
<exclude name="UnusedPrivateMethod" />
</rule>
<rule ref="rulesets/java/optimizations.xml">
<exclude name="AvoidInstantiatingObjectsInLoops" />
<exclude name="LocalVariableCouldBeFinal" />
<exclude name="MethodArgumentCouldBeFinal" />
<exclude name="RedundantFieldInitializer" />
<exclude name="UseStringBufferForStringAppends" />
<exclude name="SimplifyStartsWith" />
</rule>
</ruleset>