Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<module name="TreeWalker">
<!-- Checks - sorted alphabetically -->
<module name="ArrayTypeStyle"/>
<module name="AvoidDoubleBraceInitialization"/>
<module name="AvoidStarImport"/>
<module name="ConstantName"/>
<module name="DefaultComesLast"/>
Expand All @@ -68,6 +69,11 @@
<module name="FinalParameters"/>
<module name="GenericWhitespace"/>
<module name="HideUtilityClassConstructor"/>
<module name="IllegalCatch">
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingnpe -->
<!-- https://docs.pmd-code.org/pmd-doc-7.11.0/pmd_rules_java_errorprone.html#avoidcatchingthrowable -->
<property name="illegalClassNames" value="Error,Throwable,NullPointerException,java.lang.Error,java.lang.Throwable,java.lang.NullPointerException"/>
</module>
<module name="IllegalImport"/>
<module name="InterfaceIsType"/>
<module name="JavadocStyle">
Expand All @@ -93,7 +99,6 @@
<module name="MethodParamPad"/>
<module name="MissingDeprecated"/>
<module name="MissingOverride"/>
<module name="MissingSwitchDefault"/>
<module name="ModifierOrder"/>
<module name="NeedBraces"/>
<module name="NoClone"/>
Expand Down Expand Up @@ -122,7 +127,13 @@
</module>
<module name="TypecastParenPad"/>
<module name="TypeName"/>
<module name="UnnecessaryParentheses"/>
<module name="UnnecessarySemicolonAfterOuterTypeDeclaration"/>
<module name="UnnecessarySemicolonAfterTypeMemberDeclaration"/>
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
<module name="UnusedImports"/>
<module name="UnusedLocalVariable"/>
<module name="UpperEll"/>
<module name="VisibilityModifier">
<property name="packageAllowed" value="true"/>
Expand Down
43 changes: 39 additions & 4 deletions .config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,38 @@

<!-- Only rules that don't overlap with CheckStyle! -->

<rule ref="category/java/bestpractices.xml/AvoidPrintStackTrace"/>
<rule ref="category/java/bestpractices.xml/AvoidStringBufferField"/>
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
<rule ref="category/java/bestpractices.xml/ConstantsInInterface"/>
<rule ref="category/java/bestpractices.xml/ExhaustiveSwitchHasDefault"/>
<rule ref="category/java/bestpractices.xml/LiteralsFirstInComparisons"/>
<!-- CheckStyle can't handle this switch behavior -> delegated to PMD -->
<rule ref="category/java/bestpractices.xml/NonExhaustiveSwitch"/>
<rule ref="category/java/bestpractices.xml/OneDeclarationPerLine">
<properties>
<property name="strictMode" value="true"/>
</properties>
</rule>
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
<rule ref="category/java/bestpractices.xml/SimplifiableTestAssertion"/>
<rule ref="category/java/bestpractices.xml/SystemPrintln"/>
<rule ref="category/java/bestpractices.xml/UnusedAssignment"/>
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
<rule ref="category/java/bestpractices.xml/UseEnumCollections"/>
<rule ref="category/java/bestpractices.xml/UseStandardCharsets"/>
<rule ref="category/java/bestpractices.xml/UseTryWithResources"/>

<!-- Native code is platform dependent; Loading external native libs might pose a security threat -->
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
<rule ref="category/java/codestyle.xml/LambdaCanBeMethodReference"/>
<rule ref="category/java/codestyle.xml/NoPackage"/>
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon"/>

<rule ref="category/java/design.xml">
<!-- Sometimes abstract classes have just fields -->
Expand Down Expand Up @@ -76,9 +98,6 @@

<!-- Limit too low -->
<exclude name="UseObjectForClearerAPI"/>

<!-- Handled by checkstyle -->
<exclude name="UseUtilityClass"/>
</rule>

<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts">
Expand Down Expand Up @@ -114,17 +133,33 @@
</properties>
</rule>

<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"/>
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
<rule ref="category/java/errorprone.xml/ComparisonWithNaN"/>
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
<rule ref="category/java/errorprone.xml/DontImportSun"/>
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
<rule ref="category/java/errorprone.xml/EqualsNull"/>
<rule ref="category/java/errorprone.xml/IdempotentOperations"/>
<rule ref="category/java/errorprone.xml/ImplicitSwitchFallThrough"/>
<rule ref="category/java/errorprone.xml/InstantiationToGetClass"/>
<rule ref="category/java/errorprone.xml/InvalidLogMessageFormat"/>
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
<rule ref="category/java/errorprone.xml/MoreThanOneLogger"/>
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance"/>
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable"/>


<rule ref="category/java/multithreading.xml">
<!-- Just bloats code -->
<!-- Just bloats code; improved in JEP-491/Java 24+ -->
<exclude name="AvoidSynchronizedAtMethodLevel"/>

<!-- NOPE -->
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/broken-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6 # v2
uses: lycheeverse/lychee-action@1d97d84f0bc547f7b25f4c2170d87d810dc2fb2c # v2
with:
fail: false # Don't fail on broken links, create an issue instead

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.21.4</version>
<version>10.23.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down Expand Up @@ -82,12 +82,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.11.0</version>
<version>7.12.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.11.0</version>
<version>7.12.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
6 changes: 3 additions & 3 deletions sessionize-java-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.21.4</version>
<version>10.23.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down Expand Up @@ -522,12 +522,12 @@
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-core</artifactId>
<version>7.11.0</version>
<version>7.12.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pmd</groupId>
<artifactId>pmd-java</artifactId>
<version>7.11.0</version>
<version>7.12.0</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Loading