Repository navigation
Expand file tree
/
Copy pathpmd-ruleset.xml
More file actions
50 lines (45 loc) · 2.42 KB
/
Copy pathpmd-ruleset.xml
File metadata and controls
50 lines (45 loc) · 2.42 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
PMD rules for ScratchLog: PMD's quickstart ruleset, minus the rules that clash with the frameworks this code base
builds on. Every deviation states why it does not apply, so that the list can be revisited instead of growing
silently. Prefer narrowing a rule over excluding it, and a justified @SuppressWarnings("PMD.<Rule>") for a single
false positive.
-->
<ruleset name="ScratchLog"
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 rules for ScratchLog, based on PMD's quickstart ruleset.</description>
<rule ref="rulesets/java/quickstart.xml">
<!--
All log statements use SLF4J placeholders, so a disabled level costs at most a cheap argument evaluation.
Guarding every call with isXxxEnabled() would add noise without a measurable benefit.
-->
<exclude name="GuardLogStatement"/>
<!--
Flags classes that only hold nested types, like the *Dtos records containers, which are meant to be
used without an instance or any static member of their own.
-->
<exclude name="MissingStaticMethodInNonInstantiatableClass"/>
</rule>
<!-- Spring Data derived queries use underscores to traverse properties, e.g. countByCourse_Id. -->
<rule ref="category/java/codestyle.xml/MethodNamingConventions">
<properties>
<property name="violationSuppressXPath"
value="ancestor::ClassDeclaration[@PackageName = 'de.uni_passau.fim.se2.scratchlog.persistence.repository']"/>
</properties>
</rule>
<!-- Flyway requires Java migrations to be named V<version>__<description>. -->
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
<properties>
<property name="violationSuppressXPath"
value="self::ClassDeclaration[@PackageName = 'de.uni_passau.fim.se2.scratchlog.db.migration']"/>
</properties>
</rule>
<!-- An intentionally empty catch block is fine as long as a comment explains why. -->
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
<properties>
<property name="allowCommentedBlocks" value="true"/>
</properties>
</rule>
</ruleset>