builder: meet level 4 tweaks

* Add missing Rule SuppressWarningsFilter
* Suppress HideUtilityClassConstructor on main class
This commit is contained in:
Paul Campbell 2017-01-06 16:24:22 +00:00
parent 9eb00f5a16
commit e2069b8d0d
9 changed files with 20 additions and 1 deletions

View file

@ -276,6 +276,7 @@ Rule|Level|Source|Enabled|Suppressable
[SuperClone](#superclone)|tweaks|checkstyle|| [SuperClone](#superclone)|tweaks|checkstyle||
[SuperFinalize](#superfinalize)|tweaks|checkstyle|| [SuperFinalize](#superfinalize)|tweaks|checkstyle||
[SuppressWarnings](#suppresswarnings)|naming|checkstyle|Yes| [SuppressWarnings](#suppresswarnings)|naming|checkstyle|Yes|
[SuppressWarningsFilter](#suppresswarningsfilter)|naming|checkstyle|Yes|
[SuppressWarningsHolder](#suppresswarningsholder)|naming|checkstyle|Yes| [SuppressWarningsHolder](#suppresswarningsholder)|naming|checkstyle|Yes|
[TernaryPerExpressionCount](#ternaryperexpressioncount)|tweaks|sevntu|Yes| [TernaryPerExpressionCount](#ternaryperexpressioncount)|tweaks|sevntu|Yes|
[ThrowsCount](#throwscount)|complexity|checkstyle|Yes| [ThrowsCount](#throwscount)|complexity|checkstyle|Yes|
@ -2071,6 +2072,10 @@ Prevents the use of `@SuppressWarnings` for the following checks:
Used by Checkstyle to hold the checks to be suppressed from `@SuppressWarnings(...)` annotations. Used by Checkstyle to hold the checks to be suppressed from `@SuppressWarnings(...)` annotations.
#### [SuppressWarningsFilter](http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsFilter)
Allows the use of the `@SuppressWarnings` annotation.
#### [ThrowsCount](http://checkstyle.sourceforge.net/config_design.html#ThrowsCount) #### [ThrowsCount](http://checkstyle.sourceforge.net/config_design.html#ThrowsCount)
Restricts non-private methods to only `throws` 4 distinct Exception types. Exceptions should be hierarchical to allow catching suitable root Exceptions. Restricts non-private methods to only `throws` 4 distinct Exception types. Exceptions should be hierarchical to allow catching suitable root Exceptions.

View file

@ -25,7 +25,7 @@
<checkstyle.version>7.3</checkstyle.version> <checkstyle.version>7.3</checkstyle.version>
<sevntu-checkstyle-maven-plugin.version>1.22.0</sevntu-checkstyle-maven-plugin.version> <sevntu-checkstyle-maven-plugin.version>1.22.0</sevntu-checkstyle-maven-plugin.version>
<kemitix-checkstyle-ruleset.version>2.0.0-SNAPSHOT</kemitix-checkstyle-ruleset.version> <kemitix-checkstyle-ruleset.version>2.0.0-SNAPSHOT</kemitix-checkstyle-ruleset.version>
<kemitix-checkstyle-ruleset.level>3-javadoc</kemitix-checkstyle-ruleset.level> <kemitix-checkstyle-ruleset.level>4-tweaks</kemitix-checkstyle-ruleset.level>
</properties> </properties>
<dependencyManagement> <dependencyManagement>

View file

@ -38,6 +38,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
*/ */
@EnableConfigurationProperties({RulesProperties.class, OutputProperties.class}) @EnableConfigurationProperties({RulesProperties.class, OutputProperties.class})
@SpringBootApplication @SpringBootApplication
@SuppressWarnings("hideutilityclassconstructor")
public class CheckstyleRulesetBuilderApplication { public class CheckstyleRulesetBuilderApplication {
/** /**

View file

@ -854,6 +854,13 @@ rules:
enabled: true enabled: true
source: CHECKSTYLE source: CHECKSTYLE
uri: http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder uri: http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder
-
name: SuppressWarningsFilter
parent: CHECKER
level: NAMING
enabled: true
source: CHECKSTYLE
uri: http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsFilter
- -
name: ThrowsCount name: ThrowsCount
parent: TREEWALKER parent: TREEWALKER

View file

@ -0,0 +1,2 @@
Allows the use of the `@SuppressWarnings` annotation.

View file

@ -12,6 +12,7 @@
<module name="NewlineAtEndOfFile"> <module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/> <property name="lineSeparator" value="lf"/>
</module> </module>
<module name="SuppressWarningsFilter"/>
<module name="TreeWalker"> <module name="TreeWalker">

View file

@ -13,6 +13,7 @@
<module name="NewlineAtEndOfFile"> <module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/> <property name="lineSeparator" value="lf"/>
</module> </module>
<module name="SuppressWarningsFilter"/>
<module name="Translation"/> <module name="Translation"/>
<module name="UniqueProperties"/> <module name="UniqueProperties"/>

View file

@ -13,6 +13,7 @@
<module name="NewlineAtEndOfFile"> <module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/> <property name="lineSeparator" value="lf"/>
</module> </module>
<module name="SuppressWarningsFilter"/>
<module name="Translation"/> <module name="Translation"/>
<module name="UniqueProperties"/> <module name="UniqueProperties"/>

View file

@ -14,6 +14,7 @@
<module name="NewlineAtEndOfFile"> <module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/> <property name="lineSeparator" value="lf"/>
</module> </module>
<module name="SuppressWarningsFilter"/>
<module name="Translation"/> <module name="Translation"/>
<module name="UniqueProperties"/> <module name="UniqueProperties"/>