[bug] update the ruleset files and add missing reasons for deactivated rules

This commit is contained in:
Paul Campbell 2018-01-14 19:13:13 +00:00
parent 5a8cf1b884
commit 54fa8f0be4
8 changed files with 23 additions and 51 deletions

View file

@ -1,6 +1,12 @@
CHANGELOG
=========
3.4.1
-----
* \[bug] update the ruleset files
* Add missing reasons for disabling checks
3.4.0
-----

View file

@ -90,8 +90,8 @@ Rule|Level|Source|Enabled|Suppressible
[AvoidModifiersForTypes](#avoidmodifiersfortypes)|unspecified|sevntu||
[AvoidNestedBlocks](#avoidnestedblocks)|complexity|checkstyle|Yes|
[AvoidNotShortCircuitOperatorsForBoolean](#avoidnotshortcircuitoperatorsforboolean)|tweaks|sevntu|Yes|
[AvoidStarImport](#avoidstarimport)|layout|checkstyle|Yes|
[AvoidStaticImport](#avoidstaticimport)|complexity|checkstyle|Yes|
[AvoidStarImport](#avoidstarimport)|layout|checkstyle||
[AvoidStaticImport](#avoidstaticimport)|complexity|checkstyle||
[BooleanExpressionComplexity](#booleanexpressioncomplexity)|complexity|checkstyle|Yes|
[CatchParameterName](#catchparametername)|naming|checkstyle|Yes|
[CauseParameterInException](#causeparameterinexception)|tweaks|sevntu||
@ -414,37 +414,6 @@ Invalid:
// ...
}
````
#### [AvoidStarImport](http://checkstyle.sourceforge.net/config_imports.html#AvoidStarImport)
Prevents the use of the star import.
Invalid:
````
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
````
#### [AvoidStaticImport](http://checkstyle.sourceforge.net/config_imports.html#AvoidStaticImport)
Prevents importing static members, unless they are one of the following:
* `org.assertj.core.api.Assertions.assertThat`
* `org.mockito.BDDMockito.given`
* `org.mockito.Mockito.*`
* `org.mockito.Matchers.*`
* `org.mockito.Mockito.*`
Valid:
````
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
````
Invalid:
````
import static java.nio.charset.StandardCharsets.UTF_8;
````
#### [BooleanExpressionComplexity](http://checkstyle.sourceforge.net/config_metrics.html#BooleanExpressionComplexity)
Restrict the number of number of &&, ||, &, | and ^ in an expression to 2.
@ -1233,7 +1202,7 @@ Checks that paragraphs in Javadoc blocks are wrapped in `<p>` elements and have
Checks the formatting of the Javadoc blocks. See the official [Checkstyle documentation](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocStyle) for all the checks that are applied.
#### [JavadocType](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocType)
Checks the format for Javadoc for classes and enums. Javadoc must be present, not have any unknown tags and not missing any `@param` tags. The `@author` tag must have a name and, in brackets, an email address.
Checks the format for Javadoc for classes and enums. Javadoc must be present, not have any unknown tags and not missing any `@param` tags.
#### [JavaNCSS](http://checkstyle.sourceforge.net/config_metrics.html#JavaNCSS)
Restricts the NCSS score for methods, classes and files to 40, 1200 and 1600 respectively. The NCSS score is a measure of the number of statements within a scope.
@ -2681,6 +2650,13 @@ These checks are not enabled. Notes are included for each explaining why.
#### [ArrayTrailingComma](http://checkstyle.sourceforge.net/config_coding.html#ArrayTrailingComma)
Couldn't get my IDE's (IntelliJ) code style to match.
#### [AvoidStarImport](http://checkstyle.sourceforge.net/config_imports.html#AvoidStarImport)
Ref: Clean Code, Robert C. Martin, J1: Avoid Long Import Lists by Using Wildcards
#### [AvoidStaticImport](http://checkstyle.sourceforge.net/config_imports.html#AvoidStaticImport)
Ref: Clean Code, Robert C. Martin, J2: Don't Inherit Constants
Recommends using a static import to access constants from another class over inheriting them.
#### [FinalLocalVariable](http://checkstyle.sourceforge.net/config_coding.html#FinalLocalVariable)
Doesn't recognise Lombok's `val` as being `final`.

View file

@ -103,6 +103,7 @@ rules:
level: LAYOUT
enabled: false
source: CHECKSTYLE
reason: "Ref: Clean Code, Robert C. Martin, J1: Avoid Long Import Lists by Using Wildcards"
uri: http://checkstyle.sourceforge.net/config_imports.html#AvoidStarImport
-
name: AvoidStaticImport
@ -110,6 +111,9 @@ rules:
level: COMPLEXITY
enabled: false
source: CHECKSTYLE
reason: "Ref: Clean Code, Robert C. Martin, J2: Don't Inherit Constants
Recommends using a static import to access constants from another class over inheriting them."
uri: http://checkstyle.sourceforge.net/config_imports.html#AvoidStaticImport
properties:
excludes: org.assertj.core.api.Assertions.assertThat,org.mockito.BDDMockito.given,org.mockito.Mockito.*,org.mockito.Matchers.*,org.mockito.Mockito.*

View file

@ -22,7 +22,6 @@
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck"/>

View file

@ -25,7 +25,6 @@
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>

View file

@ -31,7 +31,6 @@
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.AtclauseOrderCheck">
<property name="tagOrder" value="@param, @author, @version, @serial, @return, @throws, @exception, @serialData, @serialField, @see, @since, @deprecated"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
@ -51,9 +50,7 @@
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck">
<property name="max" value="120"/>

View file

@ -34,7 +34,6 @@
<module name="com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck">
<property name="allowEscapesForControlCharacters" value="true"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
@ -78,9 +77,7 @@
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck">
<property name="max" value="120"/>

View file

@ -38,10 +38,6 @@
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStaticImportCheck">
<property name="excludes" value="org.assertj.core.api.Assertions.assertThat,org.mockito.BDDMockito.given,org.mockito.Mockito.*,org.mockito.Matchers.*,org.mockito.Mockito.*"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck">
<property name="max" value="2"/>
</module>
@ -99,9 +95,7 @@
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck">
<property name="classMaximum" value="1200"/>
<property name="fileMaximum" value="1600"/>