| <?xml version="1.0"?> |
| <!-- |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this work except in compliance with the License. |
| You may obtain a copy of the License in the LICENSE file, or at: |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <ruleset name="Aurora" |
| xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd"> |
| |
| <description> |
| Aurora PMD ruleset. |
| </description> |
| |
| <rule ref="rulesets/java/junit.xml"> |
| <!-- With the source code in hand, assertion messages can be redundant. --> |
| <exclude name="JUnitAssertionsShouldIncludeMessage"/> |
| |
| <!-- We have several cases where numerous assertions are valuable. --> |
| <exclude name="JUnitTestContainsTooManyAsserts"/> |
| |
| <!-- This rule seems to have false positives when the test uses helper methods for asserts. --> |
| <exclude name="JUnitTestsShouldIncludeAssert"/> |
| |
| <!-- Suffers from false positives for tests whose test cases are all defined in an abstract |
| super class. --> |
| <exclude name="TestClassWithoutTestCases"/> |
| </rule> |
| |
| <rule ref="rulesets/java/typeresolution.xml"> |
| <!-- We frequently use 'throws Exception' in test cases for convenience. --> |
| <exclude name="SignatureDeclareThrowsException"/> |
| </rule> |
| |
| <rule ref="rulesets/java/design.xml"> |
| <!-- This can trip for guice-bound classes using a package-private constructor. |
| --> |
| <exclude name="UseUtilityClass"/> |
| |
| <!-- This rule suffers from false positivies in cases where we are implementing a third-party |
| interface. --> |
| <exclude name="UseVarargs"/> |
| |
| <!-- In tests we often instantiate private utility classes, which this rule does not like. --> |
| <exclude name="AccessorClassGeneration"/> |
| |
| <!-- We're not currently focusing on localization. --> |
| <exclude name="SimpleDateFormatNeedsLocale"/> |
| <exclude name="UseLocaleWithCaseConversions"/> |
| |
| <!-- Empty methods in abstract classes can save implementers from boilerplate. --> |
| <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/> |
| <!-- We don't follow this practice, as we often prefer to keep like constants closest to where |
| they are used. --> |
| <exclude name="FieldDeclarationsShouldBeAtStartOfClass"/> |
| |
| <exclude name="GodClass"/> |
| </rule> |
| |
| <rule ref="rulesets/java/naming.xml"> |
| <!-- Requiring longer variable names can be cumbersome when applied globally. --> |
| <exclude name="ShortVariable"/> |
| <!-- Requiring shorter variable names can be cumbersome when applied globally. --> |
| <exclude name="LongVariable"/> |
| <!-- Short method names are useful on occasion, such as with factory methods: Rate.of(...). --> |
| <exclude name="ShortMethodName"/> |
| |
| <!-- There are rare, but valid, cases where short class names are useful. --> |
| <exclude name="ShortClassName"/> |
| </rule> |
| </ruleset> |