MethodTypeParameterName: enabled

This commit is contained in:
Paul Campbell 2016-09-09 19:03:10 +01:00
parent 0c12b97cd2
commit 779839dbde
2 changed files with 18 additions and 5 deletions

View file

@ -187,7 +187,7 @@ You need to include `checkstyle` as the version bundled with the `maven-checksty
* [MethodLength](#methodlength) - checkstyle - enabled
* [MethodName](#methodname) - checkstyle - enabled
* [MethodParamPad](#methodparampad) - checkstyle - enabled
* [MethodTypeParameterName](#methodtypeparametername) - checkstyle - disabled
* [MethodTypeParameterName](#methodtypeparametername) - checkstyle - enabled
* [MissingCtor](#missingctor) - checkstyle - disabled
* [MissingDeprecated](#missingdeprecated) - checkstyle - enabled
* [MissingOverride](#missingoverride) - checkstyle - disabled
@ -1396,6 +1396,22 @@ void getValue
();
````
#### [MethodTypeParameterName](http://checkstyle.sourceforge.net/config_naming.html#MethodTypeParameterName)
Restricts method generics parameters to be a single uppercase letter.
Valid:
````
List<A> getItems() {}
````
Invalid:
````
List<a> getItems() {}
List<BB> getItems() {}
List<C3> getItems() {}
````
#### [MissingDeprecated](http://checkstyle.sourceforge.net/config_annotation.html#MissingDeprecated)
Both the `@Deprecated` annotation and the Javadoc tag `@deprecated` must be used in pairs.
@ -2690,10 +2706,6 @@ Couldn't get my IDE's (IntelliJ) code style to match.
Member variables should usually be named such that it is clear what they are. Comments for clarification should be the exception.
#### [MethodTypeParameterName](http://checkstyle.sourceforge.net/config_naming.html#MethodTypeParameterName)
> TODO: enable
#### [MissingCtor](http://checkstyle.sourceforge.net/config_coding.html#MissingCtor)
> TODO: enable

View file

@ -141,6 +141,7 @@
</module>
<module name="MethodName"/> <!-- method names conform to ^[a-z][a-zA-Z0-9]*$ -->
<module name="MethodParamPad"/> <!-- verifies padding around method parameters -->
<module name="MethodTypeParameterName"/> <!-- restrict method type parameters (i.e. generics) to ^[A-Z]$ -->
<module name="MissingDeprecated"/> <!-- @Deprecated annotation must be accompanied by javadoc @deprecated -->
<module name="MissingSwitchDefault"/> <!-- switch must have a default -->
<module name="ModifiedControlVariable"> <!-- prevent for loop control being modified inside loop -->