Merge pull request #103 from kemitix/lambda-parameter-name

[ruleset] Add rule `LambdaParameterName`
This commit is contained in:
Paul Campbell 2018-08-27 14:46:47 +01:00 committed by GitHub
commit 818ce46c95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 23 additions and 1 deletions

View file

@ -1,9 +1,10 @@
CHANGELOG
=========
4.1.2
4.2.0
-----
* [ruleset] Add rule `LambdaParameterName`
* Upgrade checkstyle to 8.12
* Upgrade `sevntu` to 1.32.0
* Switch to trunk-based development

View file

@ -167,6 +167,7 @@ Rule|Level|Source|Enabled|Suppressible
[JavadocType](#javadoctype)|javadoc|checkstyle|Yes|
[JavadocVariable](#javadocvariable)|javadoc|checkstyle||
[JavaNCSS](#javancss)|complexity|checkstyle|Yes|
[LambdaParameterName](#lambdaparametername)|naming|checkstyle|Yes|
[LeftCurly](#leftcurly)|layout|checkstyle|Yes|
[LineLength](#linelength)|layout|checkstyle|Yes|
[LocalFinalVariableName](#localfinalvariablename)|naming|checkstyle|Yes|
@ -1159,6 +1160,11 @@ Checks the format for Javadoc for classes and enums. Javadoc must be present, no
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.
Too high an NCSS score suggests that the method or class is doing too much and should be decomposed into smaller units.
#### [LambdaParameterName](http://checkstyle.sourceforge.net/config_naming.html#LambdaParameterName)
Checks the format of lambda parameter names.
Identifiers must match `^[a-z][a-zA-Z0-9]*$`.
#### [LeftCurly](http://checkstyle.sourceforge.net/config_blocks.html#LeftCurly)
Checks that the left curly brace ('{') is placed at the end of the line. Does not check enums.

View file

@ -1067,6 +1067,13 @@ rules:
enabled: true
source: SEVNTU
uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html
-
name: LambdaParameterName
parent: TREEWALKER
level: NAMING
enabled: true
source: CHECKSTYLE
uri: http://checkstyle.sourceforge.net/config_naming.html#LambdaParameterName
-
name: LogicConditionNeedOptimization
parent: TREEWALKER

View file

@ -0,0 +1,4 @@
Checks the format of lambda parameter names.
Identifiers must match `^[a-z][a-zA-Z0-9]*$`.

View file

@ -85,6 +85,7 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/>

View file

@ -109,6 +109,7 @@
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/>

View file

@ -158,6 +158,7 @@
<module name="com.github.sevntu.checkstyle.checks.coding.EitherLogOrThrowCheck"/>
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.LogicConditionNeedOptimizationCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
<module name="com.github.sevntu.checkstyle.checks.design.NoMainMethodInAbstractClassCheck"/>

View file

@ -208,6 +208,7 @@
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidReturnInFinallyBlockCheck"/>
<module name="com.github.sevntu.checkstyle.checks.design.ForbidWildcardAsReturnTypeCheck"/>
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LambdaParameterNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.LogicConditionNeedOptimizationCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.MapIterationInForEachLoopCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>