-
-
Notifications
You must be signed in to change notification settings - Fork 171
/
ruleset.xml
52 lines (46 loc) · 2.13 KB
/
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
49
50
51
52
<?xml version="1.0"?>
<ruleset name="Floodgate Rules"
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 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>
Floodgate Code ruleset
</description>
<!-- UnusedPrivateMethod -->
<exclude-pattern>.*/CommonPlayerLink.*</exclude-pattern>
<!-- RedundantFieldInitializer -->
<exclude-pattern>.*/FloodgateConfig.*</exclude-pattern>
<!-- CloseResource, there is no shutdown event and it has to load classes on the fly -->
<exclude-pattern>.*/PlayerLinkLoader.*</exclude-pattern>
<!-- PreserveStackTrace -->
<exclude-pattern>.*/FloodgateHandshakeHandler.*</exclude-pattern>
<rule ref="category/java/bestpractices.xml/MissingOverride" />
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty" />
<rule ref="category/java/bestpractices.xml/UseTryWithResources" />
<rule ref="category/java/errorprone.xml/CloseResource" />
<rule ref="category/java/errorprone.xml/UseLocaleWithCaseConversions" />
<!-- got a bit lazy, just added whole sections and excluded some unnecessary ones -->
<rule ref="category/java/bestpractices.xml">
<!-- maybe add these ones back later on -->
<exclude name="AvoidPrintStackTrace" />
<exclude name="GuardLogStatement" />
</rule>
<rule ref="category/java/errorprone.xml">
<exclude name="AvoidDuplicateLiterals" />
<exclude name="AvoidLiteralsInIfCondition" /><!-- Some things just don't change :shrug: -->
<exclude name="AvoidFieldNameMatchingMethodName" />
<exclude name="BeanMembersShouldSerialize" />
<exclude name="UseProperClassLoader" />
</rule>
<rule ref="category/java/performance.xml">
<exclude name="AvoidUsingShortType" />
<exclude name="AvoidInstantiatingObjectsInLoops" /><!-- this is ok to some extend -->
<exclude name="InefficientStringBuffering" />
</rule>
<rule ref="category/java/security.xml" />
<rule ref="category/java/errorprone.xml/AssignmentInOperand">
<properties>
<property name="allowWhile" value="true" />
</properties>
</rule>
</ruleset>