HHH-11235 - split checkstyles into fatal and non-fatal configs

This commit is contained in:
Steve Ebersole 2016-11-09 11:34:51 -06:00
parent 02b234a44f
commit 737abc503f
3 changed files with 198 additions and 158 deletions

View File

@ -359,6 +359,13 @@ subprojects { subProject ->
// exclude generated java sources - by explicitly setting the base source dir // exclude generated java sources - by explicitly setting the base source dir
checkstyleMain.source = 'src/main/java' checkstyleMain.source = 'src/main/java'
// define a second checkstyle task for checking non-fatal violations
task nonFatalCheckStyle(type:Checkstyle, dependsOn: checkstyle) {
source subProject.sourceSets.main
showViolations = false
configFile = rootProject.file( 'shared/config/checkstyle/checkstyle-non-fatal.xml' )
}
findbugs { findbugs {
sourceSets = [ subProject.sourceSets.main, subProject.sourceSets.test ] sourceSets = [ subProject.sourceSets.main, subProject.sourceSets.test ]
ignoreFailures = true ignoreFailures = true

View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Hibernate, Relational Persistence for Idiomatic Java
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later
~ See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
-->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="FileContentsHolder"/>
<module name="AvoidStarImport">
<property name="severity" value="warning" />
</module>
<module name="RedundantImport">
<property name="severity" value="warning" />
</module>
<module name="UnusedImports">
<property name="severity" value="warning" />
</module>
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true" />
<property name="severity" value="warning" />
</module>
<module name="HideUtilityClassConstructor">
<property name="severity" value="warning" />
</module>
<module name="MutableException">
<property name="severity" value="warning" />
</module>
<module name="EmptyStatement">
<property name="severity" value="warning" />
</module>
<module name="MissingSwitchDefault">
<property name="severity" value="warning" />
</module>
<module name="DefaultComesLast">
<property name="severity" value="warning" />
</module>
<module name="ModifiedControlVariable">
<property name="severity" value="warning" />
</module>
<module name="SimplifyBooleanExpression">
<property name="severity" value="warning" />
</module>
<module name="SimplifyBooleanReturn">
<property name="severity" value="warning" />
</module>
<module name="ExplicitInitialization">
<property name="severity" value="warning" />
</module>
<module name="FallThrough">
<property name="severity" value="warning" />
</module>
<module name="ArrayTypeStyle">
<property name="severity" value="warning" />
</module>
<module name="TrailingComment">
<property name="severity" value="warning" />
</module>
<module name="ModifierOrder">
<property name="severity" value="warning" />
</module>
<module name="AbstractClassName">
<!-- we are just using this to make sure that classes matching the pattern (Abstract*) have the abstract modifier -->
<property name="format" value="^Abstract.*$" />
<property name="ignoreName" value="true" />
<property name="severity" value="warning" />
</module>
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$" />
<property name="severity" value="warning" />
</module>
<module name="ConstantName">
<property name="format" value="^[A-Z](_?[A-Z0-9]+)*$|log" />
<property name="severity" value="warning" />
</module>
<module name="LocalFinalVariableName">
<property name="severity" value="warning" />
</module>
<module name="LocalVariableName">
<property name="severity" value="warning" />
</module>
<module name="MemberName">
<property name="severity" value="warning" />
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$" />
<property name="severity" value="warning" />
</module>
<module name="PackageName">
<property name="severity" value="warning" />
</module>
<module name="ParameterName">
<property name="severity" value="warning" />
</module>
<module name="StaticVariableName">
<property name="severity" value="warning" />
</module>
<module name="TypeName">
<property name="severity" value="warning" />
</module>
<module name="AbbreviationAsWordInName">
<property name="severity" value="warning" />
</module>
<module name="MethodParamPad">
<property name="severity" value="warning" />
</module>
<module name="TypecastParenPad">
<property name="severity" value="warning" />
</module>
<module name="ParenPad">
<property name="tokens" value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL" />
<property name="option" value="space" />
<property name="severity" value="warning" />
</module>
</module>
<module name="JavadocPackage">
<property name="allowLegacy" value="true" />
<property name="severity" value="warning" />
</module>
<!--
Used to collect "todo" comments into a single location
-->
<module name="TreeWalker">
<module name="TodoComment">
<property name="format" value="[Tt][Oo][Dd][Oo]"/>
<property name="severity" value="info" />
</module>
</module>
<!--
Source code comment-based suppressions
-->
<module name="SuppressionCommentFilter">
<!--
Allow a finalize() method within these comments. DriverManagerConnectionProviderImpl e.g.
uses a finalizer to make sure we release all of its cached connections.
-->
<property name="offCommentFormat" value="CHECKSTYLE:START_ALLOW_FINALIZER"/>
<property name="onCommentFormat" value="CHECKSTYLE:END_ALLOW_FINALIZER"/>
<property name="checkFormat" value="NoFinalizer"/>
</module>
<module name="SuppressWithNearbyCommentFilter">
<property name="commentFormat" value="noinspection StatementWithEmptyBody"/>
<property name="checkFormat" value="EmptyStatement"/>
<property name="influenceFormat" value="1"/>
</module>
</module>

View File

@ -8,7 +8,7 @@
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd"> <!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker"> <module name="Checker">
<!-- See http://checkstyle.sourceforge.net/checks.html for details of the various checks --> <!-- Only defines "fatal" violations; there are additional "non-fatal" rules in checkstyle-non-fatal.xml -->
<module name="Header"> <module name="Header">
<property name="header" value="/*\n * Hibernate, Relational Persistence for Idiomatic Java\n *\n * License: GNU Lesser General Public License (LGPL), version 2.1 or later.\n * See the lgpl.txt file in the root directory or &lt;http://www.gnu.org/licenses/lgpl-2.1.html&gt;.\n */"/> <property name="header" value="/*\n * Hibernate, Relational Persistence for Idiomatic Java\n *\n * License: GNU Lesser General Public License (LGPL), version 2.1 or later.\n * See the lgpl.txt file in the root directory or &lt;http://www.gnu.org/licenses/lgpl-2.1.html&gt;.\n */"/>
@ -63,153 +63,6 @@
<property name="illegalPkgs" value="java.awt, sun, org.slf4j"/> <property name="illegalPkgs" value="java.awt, sun, org.slf4j"/>
</module> </module>
<!--
Medium and low priority warnings : do not fail build
-->
<module name="AvoidStarImport">
<property name="severity" value="warning" />
</module>
<module name="RedundantImport">
<property name="severity" value="warning" />
</module>
<module name="UnusedImports">
<property name="severity" value="warning" />
</module>
<module name="AvoidNestedBlocks">
<property name="allowInSwitchCase" value="true" />
<property name="severity" value="warning" />
</module>
<module name="HideUtilityClassConstructor">
<property name="severity" value="warning" />
</module>
<module name="MutableException">
<property name="severity" value="warning" />
</module>
<module name="EmptyStatement">
<property name="severity" value="warning" />
</module>
<module name="MissingSwitchDefault">
<property name="severity" value="warning" />
</module>
<module name="DefaultComesLast">
<property name="severity" value="warning" />
</module>
<module name="ModifiedControlVariable">
<property name="severity" value="warning" />
</module>
<module name="SimplifyBooleanExpression">
<property name="severity" value="warning" />
</module>
<module name="SimplifyBooleanReturn">
<property name="severity" value="warning" />
</module>
<module name="ExplicitInitialization">
<property name="severity" value="warning" />
</module>
<module name="FallThrough">
<property name="severity" value="warning" />
</module>
<module name="ArrayTypeStyle">
<property name="severity" value="warning" />
</module>
<module name="TrailingComment">
<property name="severity" value="warning" />
</module>
<module name="ModifierOrder">
<property name="severity" value="warning" />
</module>
<module name="AbstractClassName">
<!-- we are just using this to make sure that classes matching the pattern (Abstract*) have the abstract modifier -->
<property name="format" value="^Abstract.*$" />
<property name="ignoreName" value="true" />
<property name="severity" value="warning" />
</module>
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$" />
<property name="severity" value="warning" />
</module>
<module name="ConstantName">
<property name="format" value="^[A-Z](_?[A-Z0-9]+)*$|log" />
<property name="severity" value="warning" />
</module>
<module name="LocalFinalVariableName">
<property name="severity" value="warning" />
</module>
<module name="LocalVariableName">
<property name="severity" value="warning" />
</module>
<module name="MemberName">
<property name="severity" value="warning" />
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$" />
<property name="severity" value="warning" />
</module>
<module name="PackageName">
<property name="severity" value="warning" />
</module>
<module name="ParameterName">
<property name="severity" value="warning" />
</module>
<module name="StaticVariableName">
<property name="severity" value="warning" />
</module>
<module name="TypeName">
<property name="severity" value="warning" />
</module>
<module name="AbbreviationAsWordInName">
<property name="severity" value="warning" />
</module>
<module name="MethodParamPad">
<property name="severity" value="warning" />
</module>
<module name="TypecastParenPad">
<property name="severity" value="warning" />
</module>
<module name="ParenPad">
<property name="tokens" value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL" />
<property name="option" value="space" />
<property name="severity" value="warning" />
</module>
</module>
<module name="JavadocPackage">
<property name="allowLegacy" value="true" />
<property name="severity" value="warning" />
</module> </module>
<!-- We are not using NewLineAtEndOfFile because the new line chars change <!-- We are not using NewLineAtEndOfFile because the new line chars change
@ -226,16 +79,6 @@
<property name="message" value="Only one new line is allowed at the end of a file" /> <property name="message" value="Only one new line is allowed at the end of a file" />
</module> </module>
<!--
Used to collect "todo" comments into a single location
-->
<module name="TreeWalker">
<module name="TodoComment">
<property name="format" value="[Tt][Oo][Dd][Oo]"/>
<property name="severity" value="info" />
</module>
</module>
<!-- <!--
Source code comment-based suppressions Source code comment-based suppressions