forked from GeyserMC/Floodgate
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathruleset.xml
46 lines (40 loc) · 1.78 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
<?xml version="1.0"?>
<ruleset name="Connect 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>
Connect Code ruleset
</description>
<!-- RedundantFieldInitializer -->
<exclude-pattern>.*/ConnectConfig.*</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>