pom.xml: upgrade sevntu to 1.24.0

* Fixes bug in ForbidWildcardAsReturnType which is now enabled again
* Additional pluginRepositories config is no longer required
This commit is contained in:
Paul Campbell 2017-05-28 18:29:46 +01:00
parent 403d4b6504
commit 6072613b44
8 changed files with 28 additions and 103 deletions

View file

@ -66,19 +66,11 @@ The level is now specified as a configuration parameter. See the example below.
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>sevntu-maven</id>
<name>sevntu-maven</name>
<url>http://sevntu-checkstyle.github.io/sevntu.checkstyle/maven2</url>
</pluginRepository>
</pluginRepositories>
````
## All Checks
Rule|Level|Source|Enabled|Suppressable
Rule|Level|Source|Enabled|Suppressible
----|-----|------|-------|------------
[AbbreviationAsWordInName](#abbreviationaswordinname)|naming|checkstyle|Yes|
[AbstractClassName](#abstractclassname)|naming|checkstyle|Yes|
@ -143,7 +135,7 @@ Rule|Level|Source|Enabled|Suppressable
[ForbidInstantiation](#forbidinstantiation)|unspecified|sevntu||
[ForbidReturnInFinallyBlock](#forbidreturninfinallyblock)|complexity|sevntu|Yes|
[ForbidThrowAnonymousExceptions](#forbidthrowanonymousexceptions)|tweaks|sevntu||
[ForbidWildcardAsReturnType](#forbidwildcardasreturntype)|complexity|sevntu||
[ForbidWildcardAsReturnType](#forbidwildcardasreturntype)|complexity|sevntu|Yes|
[GenericWhitespace](#genericwhitespace)|layout|checkstyle|Yes|
[Header](#header)|layout|checkstyle|Yes|
[HiddenField](#hiddenfield)|tweaks|checkstyle|Yes|
@ -2264,32 +2256,13 @@ Checks that when an exception is caught, that if it is logged then it is not als
Accepts `java.util.logging.Logger` and `org.slf4j.Logger`.
#### [EnumValueName](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/naming/EnumValueNameCheck.html)
Enums are considered to be of two distinct types: 'Class' or 'Value' enumerations. The distinction being that Class Enumerations have methods (other than `toString()`) defined.
The values defined in the `enum` must match the appropriate pattern:
* Class: `^[A-Z][a-zA-Z0-9]*$`
* Value: `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`
The difference being that Class enumerations can't contain underscores but can include lowercase letters (after the first initial capital). Value enumerations can include underscores, but not as the first or second character.
Checks that Enum Values match the pattern: `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`
Valid:
````
enum ValidConstants {
enum Valid {
ALPHA, BETA;
}
enum ValidClassLike {
Alpha("a"),
Beta("b");
private String name;
ValidClassLike(String name) {
this.name = name;
}
ALPHA, BETA, GAMMA_RAY;
}
````
@ -2297,19 +2270,7 @@ Invalid:
````
enum InvalidConstants {
alpha, Beta, GAMMA_RAY;
}
enum InvalidClassLike {
alpha("a"),
beta("b");
private String name;
InvalidClassLike(String name) {
this.name = name;
}
alpha, Beta;
}
````
#### [ForbidCCommentsInMethods](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/ForbidCCommentsInMethodsCheck.html)
@ -2343,6 +2304,19 @@ try {
return true; // invalid
}
````
#### [ForbidWildcardAsReturnType](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html)
Prevents declaring a method from returning a wildcard type as its return value.
Valid:
````
<E> List<E> getList() {}
````
Invalid:
````
<E> List<? extends E> getList() {}
````
#### [LogicConditionNeedOptimization](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/LogicConditionNeedOptimizationCheck.html)
Prevent the placement of variables or fields after methods in an expression.
@ -2703,9 +2677,6 @@ Generic rule; doesn't embody a 'quality' check.
#### [ForbidThrowAnonymousExceptions](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/ForbidThrowAnonymousExceptionsCheck.html)
[IllegalThrows](#illegalthrows) performs a similar check.
#### [ForbidWildcardAsReturnType](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html)
Causes `NullPointerException` when used with `@Value.Immutables` from `org.immutables:value`
#### [RequiredParameterForAnnotation](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/annotation/RequiredParameterForAnnotationCheck.html)
Generic rule; doesn't embody a 'quality' check.

View file

@ -66,19 +66,11 @@ The level is now specified as a configuration parameter. See the example below.
</plugin>
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>sevntu-maven</id>
<name>sevntu-maven</name>
<url>http://sevntu-checkstyle.github.io/sevntu.checkstyle/maven2</url>
</pluginRepository>
</pluginRepositories>
````
## All Checks
Rule|Level|Source|Enabled|Suppressable
Rule|Level|Source|Enabled|Suppressible
----|-----|------|-------|------------
%s

View file

@ -1056,10 +1056,9 @@ rules:
name: ForbidWildcardAsReturnType
parent: TREEWALKER
level: COMPLEXITY
enabled: false
enabled: true
source: SEVNTU
uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/design/ForbidWildcardAsReturnTypeCheck.html
reason: Causes `NullPointerException` when used with `@Value.Immutables` from `org.immutables:value`
-
name: LogicConditionNeedOptimization
parent: TREEWALKER

View file

@ -1,30 +1,11 @@
Enums are considered to be of two distinct types: 'Class' or 'Value' enumerations. The distinction being that Class Enumerations have methods (other than `toString()`) defined.
The values defined in the `enum` must match the appropriate pattern:
* Class: `^[A-Z][a-zA-Z0-9]*$`
* Value: `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`
The difference being that Class enumerations can't contain underscores but can include lowercase letters (after the first initial capital). Value enumerations can include underscores, but not as the first or second character.
Checks that Enum Values match the pattern: `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`
Valid:
````
enum ValidConstants {
enum Valid {
ALPHA, BETA;
}
enum ValidClassLike {
Alpha("a"),
Beta("b");
private String name;
ValidClassLike(String name) {
this.name = name;
}
ALPHA, BETA, GAMMA_RAY;
}
````
@ -32,18 +13,6 @@ Invalid:
````
enum InvalidConstants {
alpha, Beta, GAMMA_RAY;
}
enum InvalidClassLike {
alpha("a"),
beta("b");
private String name;
InvalidClassLike(String name) {
this.name = name;
}
alpha, Beta;
}
````

View file

@ -151,11 +151,4 @@
</plugin><!-- jacoco-maven-plugin -->
</plugins>
</build>
<pluginRepositories>
<pluginRepository>
<id>sevntu-maven</id>
<name>sevntu-maven</name>
<url>http://sevntu-checkstyle.github.io/sevntu.checkstyle/maven2</url>
</pluginRepository>
</pluginRepositories>
</project>

View file

@ -60,7 +60,7 @@ public class DefaultCheckstyleExecutor implements CheckstyleExecutor {
private static final String CHECKSTYLE_ARTIFACTID = "checkstyle";
private static final String SEVNTU_GROUPID = "com.github.sevntu.checkstyle";
private static final String SEVNTU_GROUPID = "com.github.sevntu-checkstyle";
private static final String SEVNTU_ARTIFACTID = "sevntu-checkstyle-maven-plugin";

View file

@ -21,8 +21,8 @@
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
<sevntu.version>1.23.1</sevntu.version>
<checkstyle.version>7.7</checkstyle.version>
<sevntu.version>1.24.0</sevntu.version>
<mockito.version>1.10.19</mockito.version>
<assertj.version>3.8.0</assertj.version>
</properties>

View file

@ -210,6 +210,7 @@
<module name="EnumValueName"/>
<module name="ForbidCCommentsInMethods"/>
<module name="ForbidReturnInFinallyBlock"/>
<module name="ForbidWildcardAsReturnType"/>
<module name="LogicConditionNeedOptimization"/>
<module name="MapIterationInForEachLoop"/>
<module name="NameConventionForJunit4TestClasses"/>