-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathpmd-ruleset.xml
76 lines (69 loc) · 3.47 KB
/
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="sirono-common"
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>PMD Apex configuration examples for sirono-common features.</description>
<!-- NAMING -->
<rule ref="category/apex/codestyle.xml/MethodNamingConventions">
<priority>3</priority>
<properties>
<!-- Required to support the test method naming conventions in this project -->
<property name="testPattern" value="[a-z][a-zA-Z0-9_]*"/>
</properties>
</rule>
<!-- TESTS -->
<rule ref="category/apex/bestpractices.xml/ApexUnitTestClassShouldHaveAsserts">
<priority>3</priority>
<properties>
<!-- Adds support for sirono-common's Asserts utility class -->
<property name="additionalAssertMethodPattern" value="((System\.Assert|Assert|Asserts)\.\w+|verify\w+)"/>
</properties>
</rule>
<!-- SECURITY -->
<rule ref="category/apex/security.xml/ApexCRUDViolation">
<priority>3</priority>
<properties>
<!-- Adds support for sirono-common's AuthorizationUtil utility class -->
<property name="createAuthMethodPattern" value="AuthorizationUtil\.(is|assert)(Createable|Upsertable)"/>
<property name="readAuthMethodPattern" value="AuthorizationUtil\.(is|assert)Accessible"/>
<property name="updateAuthMethodPattern" value="AuthorizationUtil\.(is|assert)(Updateable|Upsertable)"/>
<property name="deleteAuthMethodPattern" value="AuthorizationUtil\.(is|assert)Deletable"/>
<property name="undeleteAuthMethodPattern" value="AuthorizationUtil\.(is|assert)Undeletable"/>
<property name="mergeAuthMethodPattern" value="AuthorizationUtil\.(is|assert)Mergeable"/>
</properties>
</rule>
<!-- EMPTY -->
<rule ref="category/apex/errorprone.xml/EmptyCatchBlock">
<priority>3</priority>
<properties>
<!-- Adds support for expected exceptions named 'ignored' and 'expected' -->
<property name="allowCommentedBlocks" type="Boolean" value="true"/>
<property name="allowExceptionNameRegex" type="Regex" value="^(ignored|expected)$"/>
</properties>
</rule>
<rule ref="category/apex/errorprone.xml/EmptyStatementBlock">
<priority>3</priority>
<properties>
<!-- Adds support for expected empty blocks in private no-arg constructors and default base methods -->
<property name="reportEmptyPrivateNoArgConstructor" value="false"/>
<property name="reportEmptyVirtualMethod" value="false"/>
</properties>
</rule>
<!-- STYLE -->
<rule ref="category/apex/codestyle.xml/OneDeclarationPerLine">
<priority>3</priority>
<properties>
<!-- Adds support for common idiom of multiple initializations in indexed for loops -->
<property name="reportInForLoopInitializer" value="false"/>
</properties>
</rule>
<!-- DOCUMENTATION -->
<rule ref="category/apex/documentation.xml/ApexDoc">
<priority>3</priority>
<properties>
<!-- ApexDoc in sirono-common does not use the @description tag -->
<property name="reportMissingDescription" value="false"/>
</properties>
</rule>
</ruleset>