This repository has been archived by the owner on Nov 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcustom-pmd-ruleset.xml
48 lines (41 loc) · 1.79 KB
/
custom-pmd-ruleset.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0"?>
<ruleset name="ExampleRuleset"
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>This ruleset should turn off some things</description>
<rule ref="rulesets/java/logging-java.xml">
<!-- Won't do that -->
<exclude name="GuardLogStatementJavaUtil"/>
</rule>
<rule ref="rulesets/java/unusedcode.xml">
<!-- It's more clear if they are written out -->
<exclude name="UnusedModifier"/>
</rule>
<rule ref="rulesets/java/naming.xml">
<!-- Better long than non descriptive -->
<exclude name="LongVariable"/>
<!-- Used in the builder pattern -->
<exclude name="AvoidFieldNameMatchingMethodName"/>
<!-- Shorter than 3 I could understand, but 5? -->
<exclude name="ShortClassName"/>
<!-- single characters for counters, won't change that -->
<exclude name="ShortVariable"/>
</rule>
<rule ref="rulesets/java/naming.xml/VariableNamingConventions">
<properties>
<!-- Private final static variables often do not indicate that they are or should be used
as constants. A final static assignment to a private variable is more likely just an
attempt to optimize based on current use within the class. Therefore, forcing a change
in case could cloud the intent rather than clarifying it.
-->
<property name="violationSuppressXPath" value="ancestor::FieldDeclaration[@Private='true' and @Final='true' and @Static='true']"/>
</properties>
</rule>
<rule ref="rulesets/java/design.xml">
<!-- Don't see why this would be accidental -->
<exclude name="UncommentedEmptyConstructor"/>
<!-- used in the builder pattern -->
<exclude name="AccessorClassGeneration"/>
</rule>
</ruleset>