Skip to content

Commit 047563f

Browse files
Merge pull request #24 from BorderTech/stopbugs
Latest QA tools
2 parents da56214 + 1f30d2c commit 047563f

File tree

7 files changed

+288
-148
lines changed

7 files changed

+288
-148
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ By default qa checks do not run, you must enable them on a per-module basis in t
1515
```xml
1616
<properties>
1717
<!--
18-
Set qa.skip to false to run QA checks.
18+
Set bt.qa.skip to false to run QA checks.
1919
2020
Note: it's called wc.qa.skip because this functionality originated in the WComponents project.
2121
-->
22-
<wc.qa.skip>false</wc.qa.skip>
22+
<bt.qa.skip>false</bt.qa.skip>
2323
</properties>
2424
```
2525

build-tools/src/main/resources/bordertech/checkstyle.xml renamed to build-tools/src/main/resources/bordertech/bt-checkstyle.xml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
44
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
55

6+
<!-- Based on sun_checks.xml -->
7+
68
<!--
79
810
Checkstyle configuration that checks the sun coding conventions from:
@@ -38,13 +40,13 @@
3840
3941
<property name="basedir" value="${basedir}"/>
4042
-->
41-
43+
4244
<!-- BorderTech Filter out Checkstyle warnings that have been suppressed with the @SuppressWarnings annotation -->
4345
<module name="SuppressWarningsFilter" />
4446

45-
<!-- BorderTech
46-
<property name="fileExtensions" value="java, properties, xml"/>
47-
-->
47+
<!-- BorderTech
48+
<property name="fileExtensions" value="java, properties, xml"/>
49+
-->
4850
<property name="fileExtensions" value="java"/>
4951

5052
<!-- Checks that a package-info.java file exists for each package. -->
@@ -78,9 +80,9 @@
7880
<module name="FileTabCharacter"/>
7981
-->
8082
<module name="RegexpSingleline">
81-
<property name="format" value="^(\t*( +\t*(?! \*|\S))|( ))"/>
82-
<property name="message" value="Indentation should be tabs."/>
83-
<property name="maximum" value="10"/>
83+
<property name="format" value="^(\t*( +\t*(?! \*|\S))|( ))"/>
84+
<property name="message" value="Indentation should be tabs."/>
85+
<property name="maximum" value="10"/>
8486
</module>
8587

8688
<!-- Miscellaneous other checks. -->
@@ -101,7 +103,7 @@
101103
<module name="TreeWalker">
102104
<!-- BorderTech -->
103105
<property name="tabWidth" value="4"/>
104-
106+
105107
<!-- BorderTech Make the @SuppressWarnings annotations available to Checkstyle -->
106108
<module name="SuppressWarningsHolder" />
107109

@@ -173,7 +175,9 @@
173175
<!-- Modifier Checks -->
174176
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
175177
<module name="ModifierOrder"/>
176-
<module name="RedundantModifier"/>
178+
<module name="RedundantModifier">
179+
<property name="severity" value="warning" />
180+
</module>
177181

178182
<!-- Checks for blocks. You know, those {}'s -->
179183
<!-- See http://checkstyle.sf.net/config_blocks.html -->
@@ -224,9 +228,9 @@
224228

225229
<!-- Miscellaneous other checks. -->
226230
<!-- See http://checkstyle.sf.net/config_misc.html -->
227-
<!--
228-
<module name="ArrayTypeStyle"/>
229-
-->
231+
<!--
232+
<module name="ArrayTypeStyle"/>
233+
-->
230234
<module name="FinalParameters"/>
231235
<module name="TodoComment">
232236
<property name="severity" value="warning" />
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<ruleset xmlns="http://pmd.sourceforge.net/ruleset/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Default Maven PMD Plugin Ruleset" xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
2+
<description>
3+
Include all categories.
4+
</description>
5+
<rule ref="category/java/bestpractices.xml"/>
6+
<rule ref="category/java/codestyle.xml">
7+
<exclude name="LongVariable"/>
8+
<exclude name="OnlyOneReturn"/>
9+
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
10+
<exclude name="LocalVariableCouldBeFinal"/>
11+
</rule>
12+
<rule ref="category/java/design.xml">
13+
<exclude name="LawOfDemeter"/>
14+
</rule>
15+
<rule ref="category/java/documentation.xml">
16+
<exclude name="CommentSize"/>
17+
</rule>
18+
<rule ref="category/java/errorprone.xml" >
19+
<exclude name="MissingSerialVersionUID"/>
20+
</rule>
21+
<rule ref="category/java/multithreading.xml"/>
22+
<rule ref="category/java/performance.xml"/>
23+
<rule ref="category/java/security.xml"/>
24+
25+
<!-- Downgrade rules from Failure to Warning. -->
26+
<rule ref="category/java/codestyle.xml/ClassNamingConventions" >
27+
<priority>3</priority>
28+
</rule>
29+
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod">
30+
<priority>3</priority>
31+
</rule>
32+
<rule ref="category/java/errorprone.xml/ReturnEmptyArrayRatherThanNull">
33+
<priority>3</priority>
34+
</rule>
35+
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance">
36+
<priority>3</priority>
37+
</rule>
38+
<rule ref="category/java/errorprone.xml/SuspiciousEqualsMethodName">
39+
<priority>3</priority>
40+
</rule>
41+
<rule ref="category/java/bestpractices.xml/GuardLogStatement" >
42+
<priority>3</priority>
43+
</rule>
44+
<rule ref="category/java/bestpractices.xml/SystemPrintln">
45+
<priority>3</priority>
46+
</rule>
47+
<rule ref="category/java/performance.xml/AvoidFileStream" >
48+
<priority>3</priority>
49+
</rule>
50+
51+
<!-- Property override not working
52+
<rule ref="category/java/documentation.xml/CommentRequired">
53+
<properties>
54+
<property name="fieldCommentRequirement">Ignored</property>
55+
</properties>
56+
</rule>
57+
-->
58+
59+
</ruleset>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<FindBugsFilter>
3+
4+
<!-- Core Bugs -->
5+
<Match>
6+
<Bug pattern="S508C_NON_TRANSLATABLE_STRING" />
7+
</Match>
8+
<!-- Auxilary Plugin Bugs -->
9+
<Match>
10+
<Bug pattern="CLI_CONSTANT_LIST_INDEX, FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY,LII_LIST_INDEXED_ITERATING, LSYC_LOCAL_SYNCHRONIZED_COLLECTION, LUI_USE_SINGLETON_LIST, PCOA_PARTIALLY_CONSTRUCTED_OBJECT_ACCESS,PDP_POORLY_DEFINED_PARAMETER,MUI_CONTAINSKEY_BEFORE_GET,PMB_POSSIBLE_MEMORY_BLOAT,SPP_EQUALS_ON_ENUM,SUI_CONTAINS_BEFORE_ADD" />
11+
</Match>
12+
13+
<!-- Seems to give false positives. -->
14+
<Match>
15+
<Bug pattern="BED_BOGUS_EXCEPTION_DECLARATION" />
16+
</Match>
17+
18+
</FindBugsFilter>

build-tools/src/main/resources/bordertech/findbugs-exclude-filter.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

pom.xml

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<packaging>pom</packaging>
1212

1313
<properties>
14-
<surefireArgLine />
15-
<surefire.version>2.22.0</surefire.version>
1614
<maven.compiler.target>1.8</maven.compiler.target>
1715
<maven.compiler.source>1.8</maven.compiler.source>
1816
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -94,22 +92,6 @@
9492
</repository>
9593
</distributionManagement>
9694

97-
<dependencyManagement>
98-
<dependencies>
99-
<dependency>
100-
<groupId>org.apache.commons</groupId>
101-
<artifactId>commons-lang3</artifactId>
102-
<version>3.8</version>
103-
<type>jar</type>
104-
</dependency>
105-
<dependency>
106-
<groupId>junit</groupId>
107-
<artifactId>junit</artifactId>
108-
<version>4.12</version>
109-
</dependency>
110-
</dependencies>
111-
</dependencyManagement>
112-
11395
<build>
11496
<pluginManagement>
11597
<plugins>
@@ -133,6 +115,7 @@
133115
</executions>
134116
</plugin>
135117

118+
<!-- Assembly -->
136119
<plugin>
137120
<artifactId>maven-assembly-plugin</artifactId>
138121
<configuration>
@@ -157,18 +140,19 @@
157140
<releaseProfiles>release</releaseProfiles>
158141
</configuration>
159142
</plugin>
160-
161143
</plugins>
162144
</pluginManagement>
163145

164146
<plugins>
147+
165148
<!-- Compile the java source. -->
166149
<plugin>
167150
<groupId>org.apache.maven.plugins</groupId>
168151
<artifactId>maven-compiler-plugin</artifactId>
169152
<version>3.8.0</version>
170153
</plugin>
171154

155+
<!-- Javadoc -->
172156
<plugin>
173157
<groupId>org.apache.maven.plugins</groupId>
174158
<artifactId>maven-javadoc-plugin</artifactId>
@@ -197,6 +181,7 @@
197181
</executions>
198182
</plugin>
199183

184+
<!-- Enforcer -->
200185
<plugin>
201186
<groupId>org.apache.maven.plugins</groupId>
202187
<artifactId>maven-enforcer-plugin</artifactId>
@@ -221,24 +206,10 @@
221206
<dependency>
222207
<groupId>org.codehaus.mojo</groupId>
223208
<artifactId>extra-enforcer-rules</artifactId>
224-
<version>1.0-beta-9</version>
225-
</dependency>
226-
</dependencies>
227-
</plugin>
228-
229-
<plugin>
230-
<groupId>org.apache.maven.plugins</groupId>
231-
<artifactId>maven-surefire-plugin</artifactId>
232-
<version>${surefire.version}</version>
233-
<dependencies>
234-
<dependency>
235-
<groupId>org.apache.maven.surefire</groupId>
236-
<artifactId>surefire-junit47</artifactId>
237-
<version>${surefire.version}</version>
209+
<version>1.1</version>
238210
</dependency>
239211
</dependencies>
240212
</plugin>
241-
242213
</plugins>
243214
</build>
244215

0 commit comments

Comments
 (0)