Skip to content

Commit

Permalink
Configure custom PMD ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
durimkryeziu committed Nov 17, 2024
1 parent 3378187 commit 032addc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ testing {
pmd {
consoleOutput = true
toolVersion = libs.versions.pmd.get()
ruleSets = ["category/java/errorprone.xml",
"category/java/bestpractices.xml",
"category/java/performance.xml"]
ruleSets = []
ruleSetFiles = files(file("${rootProject.projectDir}/config/pmd/ruleset.xml"))
}
19 changes: 19 additions & 0 deletions config/pmd/ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>

<ruleset name="Custom 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>
Exercises for Programmers - custom rules
</description>

<rule ref="category/java/errorprone.xml"/>
<rule ref="category/java/bestpractices.xml">
<exclude name="JUnitTestsShouldIncludeAssert"/>
<exclude name="JUnitTestContainsTooManyAsserts"/>
</rule>
<rule ref="category/java/performance.xml"/>

</ruleset>

0 comments on commit 032addc

Please sign in to comment.