fix(pmd): update rules for test conventions and style preferences

- Allow underscores in JUnit 5 test method names (junit5TestPattern)
- Exclude LocalVariableCouldBeFinal (style preference, not a bug)
- Exclude MethodArgumentCouldBeFinal (style preference)
- Exclude LinguisticNaming (getter-like test names are fine)
- Exclude UseUnderscoresInNumericLiterals (12345L is readable)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Daniel SamsonandClaude Opus 4.5 committed 2026-01-22 02:10:06 +00:00
1 parent 0a846cc9d5
commit d3ef55a8ce
1 file changed
+11
+11
View File
@@ -48,6 +48,12 @@
<exclude name="CommentDefaultAccessModifier"/>
<!-- Java 21+ has useful implicit classes -->
<exclude name="UnnecessaryFullyQualifiedName"/>
<!-- Final local vars are a style preference, not a bug -->
<exclude name="LocalVariableCouldBeFinal"/>
<!-- Final method args are a style preference -->
<exclude name="MethodArgumentCouldBeFinal"/>
<!-- Getter-like test names (getX_shouldY) are fine -->
<exclude name="LinguisticNaming"/>
</rule>
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
@@ -60,9 +66,12 @@
<properties>
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="nativePattern" value="[a-z][a-zA-Z0-9]*"/>
<!-- Allow underscores in JUnit 5 test method names (BDD style: method_condition_result) -->
<property name="junit5TestPattern" value="[a-z][a-zA-Z0-9_]*"/>
</properties>
</rule>
<!-- ================================================================== -->
<!-- DESIGN -->
<!-- ================================================================== -->
@@ -123,6 +132,8 @@
<exclude name="BeanMembersShouldSerialize"/>
<!-- Too strict -->
<exclude name="DataflowAnomalyAnalysis"/>
<!-- Underscores in numeric literals optional for small numbers -->
<exclude name="UseUnderscoresInNumericLiterals"/>
</rule>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">