Skip to content

Commit 2e87613

Browse files
Fix Gradle PMD and Checkstyle (#1318)
* Fixes #1306 Nested Cases with Complex Expressions * Reduce coverage for Java 8 * GROUP BY with Complex Expressions Fixes #1308 * Update Sets with Complex Expressions Fixes #1316 * Update Sets with Complex Expressions Fix existing tests Add tests for the new functionality * Implement PMD/Codacy recommendations * Add Checkstyle Configuration to Gradle Add Checkstyle Config files Fix additional exceptions in Test Sources
1 parent 3f2e76c commit 2e87613

File tree

11 files changed

+2233
-87
lines changed

11 files changed

+2233
-87
lines changed

build.gradle

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
id 'jacoco'
66
id "com.github.spotbugs" version "4.7.2"
77
id 'pmd'
8+
id 'checkstyle'
89

910
// download the RR tools which have no Maven Repository
1011
id "de.undercouch.download" version "4.1.2"
@@ -44,6 +45,10 @@ compileJavacc {
4445
java {
4546
withSourcesJar()
4647
withJavadocJar()
48+
49+
spotbugs
50+
pmd
51+
4752
}
4853

4954
jacoco {
@@ -98,9 +103,10 @@ pmd {
98103

99104
sourceSets = [sourceSets.main]
100105

101-
// clear the ruleset in order to use configured rules only, although we should apply the Prio 1 rules eventually
106+
// clear the ruleset in order to use configured rules only
102107
ruleSets = []
103-
rulesMinimumPriority = 1
108+
109+
//rulesMinimumPriority = 1
104110

105111
ruleSetFiles = files("ruleset.xml")
106112

@@ -111,6 +117,19 @@ pmd {
111117
}
112118
}
113119

120+
checkstyle {
121+
toolVersion "8.45.1"
122+
sourceSets = [sourceSets.main, sourceSets.test]
123+
configFile =rootProject.file('config/checkstyle/checkstyle.xml')
124+
}
125+
126+
tasks.withType(Checkstyle) {
127+
reports {
128+
xml.required = false
129+
html.required = true
130+
}
131+
}
132+
114133
task renderRR() {
115134
doLast {
116135
// these WAR files have been provided as a courtesy by Gunther Rademacher

config/checkstyle/checkstyle.xml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE module PUBLIC
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
5+
6+
<module name="Checker">
7+
<module name="SuppressWarningsFilter" />
8+
<module name="FileTabCharacter" />
9+
<!-- git checkout may change linefeeds on the fly
10+
<module name="RegexpMultiline">
11+
<property name="format" value="(?s:(\r\n|\r).*)" />
12+
<property name="message" value="CRLF and CR line endings are prohibited, but this file uses them." />
13+
</module>
14+
-->
15+
<module name="TreeWalker">
16+
<module name="AvoidNestedBlocks" />
17+
<module name="ConstantName" />
18+
<module name="EmptyCatchBlock" />
19+
<module name="EmptyStatement" />
20+
<module name="MissingOverride" />
21+
<module name="MultipleVariableDeclarations" />
22+
<module name="ParameterAssignment" />
23+
<module name="StringLiteralEquality" />
24+
<module name="RedundantImport" />
25+
<module name="UnusedImports" />
26+
27+
<module name="WhitespaceAfter" />
28+
29+
<module name="NeedBraces" />
30+
<module name="UnnecessaryParentheses" />
31+
<module name="LeftCurly" />
32+
<module name="RightCurly" />
33+
34+
<module name="SuppressWarningsHolder" />
35+
</module>
36+
</module>

0 commit comments

Comments
 (0)