[ruleset] Add rule LambdaParameterName

This commit is contained in:
Paul Campbell 2018-08-27 13:46:21 +01:00
parent 7f0ece0d5f
commit 9bb66eb993
8 changed files with 23 additions and 1 deletions

View file

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

View file

@ -167,6 +167,7 @@ Rule|Level|Source|Enabled|Suppressible
[JavadocType](#javadoctype)|javadoc|checkstyle|Yes| [JavadocType](#javadoctype)|javadoc|checkstyle|Yes|
[JavadocVariable](#javadocvariable)|javadoc|checkstyle|| [JavadocVariable](#javadocvariable)|javadoc|checkstyle||
[JavaNCSS](#javancss)|complexity|checkstyle|Yes| [JavaNCSS](#javancss)|complexity|checkstyle|Yes|
[LambdaParameterName](#lambdaparametername)|naming|checkstyle|Yes|
[LeftCurly](#leftcurly)|layout|checkstyle|Yes| [LeftCurly](#leftcurly)|layout|checkstyle|Yes|
[LineLength](#linelength)|layout|checkstyle|Yes| [LineLength](#linelength)|layout|checkstyle|Yes|
[LocalFinalVariableName](#localfinalvariablename)|naming|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. 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. 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) #### [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. 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 enabled: true
source: SEVNTU source: SEVNTU
uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html 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 name: LogicConditionNeedOptimization
parent: TREEWALKER 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.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/> <module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/> <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.NameConventionForJunit4TestClassesCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/> <module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/> <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.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/> <module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/> <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.NameConventionForJunit4TestClassesCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/> <module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/> <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.coding.EitherLogOrThrowCheck"/>
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/> <module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/> <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.LogicConditionNeedOptimizationCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/> <module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
<module name="com.github.sevntu.checkstyle.checks.design.NoMainMethodInAbstractClassCheck"/> <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.ForbidCCommentsInMethodsCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidReturnInFinallyBlockCheck"/> <module name="com.github.sevntu.checkstyle.checks.coding.ForbidReturnInFinallyBlockCheck"/>
<module name="com.github.sevntu.checkstyle.checks.design.ForbidWildcardAsReturnTypeCheck"/> <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.LogicConditionNeedOptimizationCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.MapIterationInForEachLoopCheck"/> <module name="com.github.sevntu.checkstyle.checks.coding.MapIterationInForEachLoopCheck"/>
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/> <module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>