Skip to content

Commit 6420787

Browse files
Update latest Dependencies and modify checkstyle rules to work with latest version 8.30.
1 parent 55deb59 commit 6420787

File tree

3 files changed

+88
-65
lines changed

3 files changed

+88
-65
lines changed
Lines changed: 74 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0"?>
22
<!DOCTYPE module PUBLIC
3-
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
4-
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
3+
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
4+
"https://checkstyle.org/dtds/configuration_1_3.dtd">
55

6-
<!-- Based on sun_checks.xml (V8.2) -->
6+
<!-- Based on sun_checks.xml (V8.30) -->
77

88
<!--
99
Checkstyle configuration that checks the sun coding conventions from:
@@ -15,7 +15,7 @@
1515
- the JDK Api documentation https://docs.oracle.com/en/java/javase/11/
1616
- some best practices
1717
Checkstyle is very configurable. Be sure to read the documentation at
18-
http://checkstyle.sourceforge.net (or in your downloaded distribution).
18+
https://checkstyle.org (or in your downloaded distribution).
1919
Most Checks are configurable, be sure to consult the documentation.
2020
To completely disable a check, just comment it out or delete it from the file.
2121
Finally, it is worth reading the documentation.
@@ -28,12 +28,12 @@
2828
https://checkstyle.org/5.x/config.html#Checker
2929
<property name="basedir" value="${basedir}"/>
3030
-->
31+
<property name="severity" value="error"/>
3132

32-
33-
<!-- BorderTech Filter out Checkstyle warnings that have been suppressed with the @SuppressWarnings annotation -->
33+
<!-- BorderTech: Filter out Checkstyle warnings that have been suppressed with the @SuppressWarnings annotation -->
3434
<module name="SuppressWarningsFilter" />
3535

36-
<!-- BorderTech
36+
<!-- BorderTech: only check java files
3737
<property name="fileExtensions" value="java, properties, xml"/>
3838
-->
3939
<property name="fileExtensions" value="java"/>
@@ -44,118 +44,131 @@
4444
<property name="fileNamePattern" value="module\-info\.java$"/>
4545
</module>
4646

47+
<!-- https://checkstyle.org/config_filters.html#SuppressionFilter -->
48+
<module name="SuppressionFilter">
49+
<property name="file" value="${org.checkstyle.sun.suppressionfilter.config}"
50+
default="checkstyle-suppressions.xml" />
51+
<property name="optional" value="true"/>
52+
</module>
53+
4754
<!-- Checks that a package-info.java file exists for each package. -->
48-
<!-- See http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage -->
55+
<!-- See https://checkstyle.org/config_javadoc.html#JavadocPackage -->
4956
<module name="JavadocPackage"/>
5057

5158
<!-- Checks whether files end with a new line. -->
52-
<!-- See http://checkstyle.sourceforge.net/config_misc.html#NewlineAtEndOfFile -->
53-
<module name="NewlineAtEndOfFile">
54-
<!-- BorderTech
55-
Choosing "lf" should allow eof to be either "LF" or "CRLF" (both end with "LF").
56-
This is more permissive and more predicatable than the default "enforce whatever line separator is default on the current platform".
57-
When fetching code via git newlines are usually normalized anyway.
58-
-->
59-
<property name="lineSeparator" value="lf"/>
60-
</module>
59+
<!-- See https://checkstyle.org/config_misc.html#NewlineAtEndOfFile -->
60+
<module name="NewlineAtEndOfFile"/>
6161

6262
<!-- Checks that property files contain the same keys. -->
63-
<!-- See http://checkstyle.sourceforge.net/config_misc.html#Translation -->
63+
<!-- See https://checkstyle.org/config_misc.html#Translation -->
6464
<module name="Translation"/>
6565

6666
<!-- Checks for Size Violations. -->
67-
<!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
67+
<!-- See https://checkstyle.org/config_sizes.html -->
6868
<module name="FileLength">
69+
<!-- Bordertech: override to warning -->
70+
<property name="severity" value="warning" />
71+
</module>
72+
<module name="LineLength">
73+
<property name="fileExtensions" value="java"/>
74+
<!-- BorderTech: override from 80 to 150 -->
75+
<property name="max" value="150" />
76+
<!-- Bordertech: override to warning -->
6977
<property name="severity" value="warning" />
7078
</module>
7179

72-
<!-- Checks for whitespace -->
73-
<!-- See http://checkstyle.sourceforge.net/config_whitespace.html -->
74-
<!--
80+
<!-- See https://checkstyle.org/config_whitespace.html -->
81+
<!-- Bordetech: This check is removed as it fails if there are tabs
7582
<module name="FileTabCharacter"/>
7683
-->
84+
<!-- Bordertech: Use tabs for indenting -->
7785
<module name="RegexpSingleline">
7886
<property name="format" value="^(\t*( +\t*(?! \*|\S))|( ))"/>
7987
<property name="message" value="Indentation should be tabs."/>
8088
<property name="maximum" value="10"/>
8189
</module>
8290

8391
<!-- Miscellaneous other checks. -->
84-
<!-- See http://checkstyle.sourceforge.net/config_misc.html -->
92+
<!-- See https://checkstyle.org/config_misc.html -->
8593
<module name="RegexpSingleline">
8694
<property name="format" value="\s+$"/>
87-
<property name="maximum" value="10"/>
95+
<property name="minimum" value="0"/>
96+
<property name="maximum" value="0"/>
8897
<property name="message" value="Line has trailing spaces."/>
98+
<!-- Bordertech: override to warning -->
99+
<property name="severity" value="warning" />
89100
</module>
90101

91102
<!-- Checks for Headers -->
92-
<!-- See http://checkstyle.sourceforge.net/config_header.html -->
103+
<!-- See https://checkstyle.org/config_header.html -->
93104
<!-- <module name="Header"> -->
94105
<!-- <property name="headerFile" value="${checkstyle.header.file}"/> -->
95106
<!-- <property name="fileExtensions" value="java"/> -->
96107
<!-- </module> -->
97108

98109
<module name="TreeWalker">
99-
<!-- BorderTech -->
110+
111+
<!-- BorderTech: Override for how many spaces a tab takes from 8 to 4 -->
100112
<property name="tabWidth" value="4"/>
101113

102-
<!-- BorderTech Make the @SuppressWarnings annotations available to Checkstyle -->
114+
<!-- BorderTech: Make the @SuppressWarnings annotations available to Checkstyle -->
103115
<module name="SuppressWarningsHolder" />
104116

105117
<!-- Checks for Javadoc comments. -->
106-
<!-- See http://checkstyle.sourceforge.net/config_javadoc.html -->
118+
<!-- See https://checkstyle.org/config_javadoc.html -->
119+
<module name="InvalidJavadocPosition"/>
107120
<module name="JavadocMethod">
121+
<!-- Bordertech: Javadoc not required for methods with these annotations -->
108122
<property name="allowedAnnotations" value="Override,Test,Before,After,BeforeClass,AfterClass"/>
109123
</module>
110124
<module name="JavadocType"/>
111125
<module name="JavadocVariable">
126+
<!-- Bordertech: Push scope that is checked from private to protected -->
112127
<property name="scope" value="protected"/>
113128
</module>
114129
<module name="JavadocStyle"/>
130+
<module name="MissingJavadocMethod"/>
115131

116132
<!-- Checks for Naming Conventions. -->
117-
<!-- See http://checkstyle.sourceforge.net/config_naming.html -->
118-
<module name="ConstantName" />
133+
<!-- See https://checkstyle.org/config_naming.html -->
134+
<module name="ConstantName"/>
119135
<module name="LocalFinalVariableName"/>
120136
<module name="LocalVariableName"/>
121137
<module name="MemberName"/>
122138
<module name="MethodName"/>
123139
<module name="PackageName"/>
124140
<module name="ParameterName"/>
125141
<module name="StaticVariableName"/>
126-
<module name="TypeName" />
142+
<module name="TypeName"/>
127143

128144
<!-- Checks for imports -->
129-
<!-- See http://checkstyle.sourceforge.net/config_import.html -->
145+
<!-- See https://checkstyle.org/config_import.html -->
130146
<module name="AvoidStarImport"/>
131147
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
132148
<module name="RedundantImport"/>
133149
<module name="UnusedImports">
134-
<!-- BorderTech -->
150+
<!-- BorderTech: Check javadoc as well -->
135151
<property name="processJavadoc" value="true" />
136152
</module>
137153

138154
<!-- Checks for Size Violations. -->
139-
<!-- See http://checkstyle.sourceforge.net/config_sizes.html -->
140-
<module name="LineLength">
141-
<!-- BorderTech -->
142-
<property name="max" value="150" />
143-
<property name="severity" value="warning" />
144-
</module>
155+
<!-- See https://checkstyle.org/config_sizes.html -->
145156
<module name="MethodLength">
157+
<!-- Bordertech: override to warning -->
146158
<property name="severity" value="warning" />
147159
</module>
148160
<module name="ParameterNumber">
161+
<!-- Bordertech: override to warning -->
149162
<property name="severity" value="warning" />
150163
</module>
151164

152165
<!-- Checks for whitespace -->
153-
<!-- See http://checkstyle.sourceforge.net/config_whitespace.html -->
166+
<!-- See https://checkstyle.org/config_whitespace.html -->
154167
<module name="EmptyForIteratorPad"/>
155168
<module name="GenericWhitespace"/>
156169
<module name="MethodParamPad"/>
157170
<module name="NoWhitespaceAfter">
158-
<!-- BorderTech -->
171+
<!-- BorderTech: Tokens to check -->
159172
<property name="tokens" value="BNOT,DEC,DOT,INC,LNOT,UNARY_MINUS,UNARY_PLUS"/>
160173
</module>
161174
<module name="NoWhitespaceBefore"/>
@@ -166,53 +179,55 @@
166179
<module name="WhitespaceAround"/>
167180

168181
<!-- Modifier Checks -->
169-
<!-- See http://checkstyle.sourceforge.net/config_modifiers.html -->
182+
<!-- See https://checkstyle.org/config_modifiers.html -->
170183
<module name="ModifierOrder"/>
171184
<module name="RedundantModifier">
185+
<!-- Bordertech: override to warning -->
172186
<property name="severity" value="warning" />
173187
</module>
174188

175189
<!-- Checks for blocks. You know, those {}'s -->
176190
<!-- See http://checkstyle.sourceforge.net/config_blocks.html -->
177191
<module name="AvoidNestedBlocks">
178-
<!-- BorderTech -->
192+
<!-- BorderTech: Allow a nested block in a switch -->
179193
<property name="allowInSwitchCase" value="true"/>
180194
</module>
181195
<module name="EmptyBlock">
196+
<!-- Bordertech: override to warning -->
182197
<property name="severity" value="warning" />
183198
</module>
184199
<module name="LeftCurly"/>
185200
<module name="NeedBraces"/>
186201
<module name="RightCurly"/>
187202

188203
<!-- Checks for common coding problems -->
189-
<!-- See http://checkstyle.sourceforge.net/config_coding.html -->
190-
<!-- BorderTech
191-
<module name="AvoidInlineConditionals"/>
192-
-->
204+
<!-- See https://checkstyle.org/config_coding.html -->
193205
<module name="EmptyStatement">
206+
<!-- Bordertech: override to warning -->
194207
<property name="severity" value="warning" />
195208
</module>
196209
<module name="EqualsHashCode"/>
197210
<module name="HiddenField">
198-
<!-- BorderTech -->
211+
<!-- Bordertech: override to ignore -->
199212
<property name="severity" value="ignore" />
200213
</module>
201214
<module name="IllegalInstantiation"/>
202215
<module name="InnerAssignment"/>
203216
<module name="MagicNumber">
217+
<!-- Bordertech: override to ignore -->
204218
<property name="severity" value="ignore" />
205219
</module>
206220
<module name="MissingSwitchDefault">
221+
<!-- Bordertech: override to warning -->
207222
<property name="severity" value="warning" />
208223
</module>
209224
<module name="MultipleVariableDeclarations"/>
210225
<module name="SimplifyBooleanExpression"/>
211226
<module name="SimplifyBooleanReturn"/>
212227

213228
<!-- Checks for class design -->
214-
<!-- See http://checkstyle.sourceforge.net/config_design.html -->
215-
<!-- BorderTech
229+
<!-- See https://checkstyle.org/config_design.html -->
230+
<!-- BorderTech: This check is specific for library projects (not applications)
216231
<module name="DesignForExtension"/>
217232
-->
218233
<module name="FinalClass"/>
@@ -221,16 +236,24 @@
221236
<module name="VisibilityModifier"/>
222237

223238
<!-- Miscellaneous other checks. -->
224-
<!-- See http://checkstyle.sourceforge.net/config_misc.html -->
239+
<!-- See https://checkstyle.org/config_misc.html -->
225240
<!--
226241
<module name="ArrayTypeStyle"/>
227242
-->
228243
<module name="FinalParameters"/>
229244
<module name="TodoComment">
245+
<!-- Bordertech: override to warning -->
230246
<property name="severity" value="warning" />
231247
</module>
232248
<module name="UpperEll"/>
233249

250+
<!-- https://checkstyle.org/config_filters.html#SuppressionXpathFilter -->
251+
<module name="SuppressionXpathFilter">
252+
<property name="file" value="${org.checkstyle.sun.suppressionxpathfilter.config}"
253+
default="checkstyle-xpath-suppressions.xml" />
254+
<property name="optional" value="true"/>
255+
</module>
256+
234257
</module>
235258

236259
</module>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
<plugin>
158158
<groupId>org.apache.maven.plugins</groupId>
159159
<artifactId>maven-javadoc-plugin</artifactId>
160-
<version>3.1.1</version>
160+
<version>3.2.0</version>
161161
<configuration>
162162
<archive>
163163
<manifestEntries>
@@ -186,7 +186,7 @@
186186
<plugin>
187187
<groupId>org.apache.maven.plugins</groupId>
188188
<artifactId>maven-enforcer-plugin</artifactId>
189-
<version>3.0.0-M2</version>
189+
<version>3.0.0-M3</version>
190190
<executions>
191191
<execution>
192192
<id>enforcer</id>
@@ -236,7 +236,7 @@
236236
<plugin>
237237
<groupId>org.apache.maven.plugins</groupId>
238238
<artifactId>maven-source-plugin</artifactId>
239-
<version>3.1.0</version>
239+
<version>3.2.1</version>
240240
<configuration>
241241
<archive>
242242
<manifestEntries>

qa-parent/pom.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@
5252
<mavenSettingsProxyId />
5353

5454
<!-- Versions -->
55-
<bt.junit.version>5.5.0</bt.junit.version>
56-
<bt.jacoco.plugin.version>0.8.4</bt.jacoco.plugin.version>
55+
<bt.junit.version>5.6.0</bt.junit.version>
56+
<bt.jacoco.plugin.version>0.8.5</bt.jacoco.plugin.version>
5757
<bt.surefire.plugin.version>2.22.2</bt.surefire.plugin.version>
58-
<bt.checkstyle.plugin.version>3.0.0</bt.checkstyle.plugin.version>
59-
<bt.checkstyle.version>8.22</bt.checkstyle.version>
60-
<bt.pmd.plugin.version>3.12.0</bt.pmd.plugin.version>
61-
<bt.pmd.version>6.16.0</bt.pmd.version>
62-
<bt.spotbugs.plugin.version>3.1.11</bt.spotbugs.plugin.version>
63-
<bt.fb-contrib.plugin.version>7.4.5</bt.fb-contrib.plugin.version>
64-
<bt.spotbugs.version>3.1.12</bt.spotbugs.version>
65-
<bt.findsecbugs.plugin.version>1.9.0</bt.findsecbugs.plugin.version>
66-
<bt.owasp.plugin.version>5.0.0-M3</bt.owasp.plugin.version>
58+
<bt.checkstyle.plugin.version>3.1.1</bt.checkstyle.plugin.version>
59+
<bt.checkstyle.version>8.30</bt.checkstyle.version>
60+
<bt.pmd.plugin.version>3.13.0</bt.pmd.plugin.version>
61+
<bt.pmd.version>6.22.0</bt.pmd.version>
62+
<bt.spotbugs.plugin.version>4.0.0</bt.spotbugs.plugin.version>
63+
<bt.fb-contrib.plugin.version>7.4.7</bt.fb-contrib.plugin.version>
64+
<bt.spotbugs.version>4.0.1</bt.spotbugs.version>
65+
<bt.findsecbugs.plugin.version>1.10.1</bt.findsecbugs.plugin.version>
66+
<bt.owasp.plugin.version>5.2.4</bt.owasp.plugin.version>
6767

6868
</properties>
6969

0 commit comments

Comments
 (0)