commit
90b5f33048
47 changed files with 1426 additions and 664 deletions
11
CHANGELOG
11
CHANGELOG
|
@ -1,6 +1,17 @@
|
||||||
CHANGELOG
|
CHANGELOG
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
3.1.0
|
||||||
|
-----
|
||||||
|
|
||||||
|
* Upgrade checkstyle to 7.8
|
||||||
|
* Upgrade sevntu to 1.24.0
|
||||||
|
* Add Rule: MoveVariableInsideIf
|
||||||
|
* Add Rule: ForbidWildcardAsReturnType
|
||||||
|
* Modify Rule: ExplicitInitialization only applies to objects
|
||||||
|
* Add Wercker CI
|
||||||
|
* Add Shippable CI
|
||||||
|
|
||||||
3.0.1
|
3.0.1
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
99
README.md
99
README.md
|
@ -66,19 +66,11 @@ The level is now specified as a configuration parameter. See the example below.
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</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
|
## All Checks
|
||||||
|
|
||||||
Rule|Level|Source|Enabled|Suppressable
|
Rule|Level|Source|Enabled|Suppressible
|
||||||
----|-----|------|-------|------------
|
----|-----|------|-------|------------
|
||||||
[AbbreviationAsWordInName](#abbreviationaswordinname)|naming|checkstyle|Yes|
|
[AbbreviationAsWordInName](#abbreviationaswordinname)|naming|checkstyle|Yes|
|
||||||
[AbstractClassName](#abstractclassname)|naming|checkstyle|Yes|
|
[AbstractClassName](#abstractclassname)|naming|checkstyle|Yes|
|
||||||
|
@ -143,7 +135,7 @@ Rule|Level|Source|Enabled|Suppressable
|
||||||
[ForbidInstantiation](#forbidinstantiation)|unspecified|sevntu||
|
[ForbidInstantiation](#forbidinstantiation)|unspecified|sevntu||
|
||||||
[ForbidReturnInFinallyBlock](#forbidreturninfinallyblock)|complexity|sevntu|Yes|
|
[ForbidReturnInFinallyBlock](#forbidreturninfinallyblock)|complexity|sevntu|Yes|
|
||||||
[ForbidThrowAnonymousExceptions](#forbidthrowanonymousexceptions)|tweaks|sevntu||
|
[ForbidThrowAnonymousExceptions](#forbidthrowanonymousexceptions)|tweaks|sevntu||
|
||||||
[ForbidWildcardAsReturnType](#forbidwildcardasreturntype)|complexity|sevntu||
|
[ForbidWildcardAsReturnType](#forbidwildcardasreturntype)|complexity|sevntu|Yes|
|
||||||
[GenericWhitespace](#genericwhitespace)|layout|checkstyle|Yes|
|
[GenericWhitespace](#genericwhitespace)|layout|checkstyle|Yes|
|
||||||
[Header](#header)|layout|checkstyle|Yes|
|
[Header](#header)|layout|checkstyle|Yes|
|
||||||
[HiddenField](#hiddenfield)|tweaks|checkstyle|Yes|
|
[HiddenField](#hiddenfield)|tweaks|checkstyle|Yes|
|
||||||
|
@ -189,6 +181,7 @@ Rule|Level|Source|Enabled|Suppressable
|
||||||
[MissingSwitchDefault](#missingswitchdefault)|tweaks|checkstyle|Yes|
|
[MissingSwitchDefault](#missingswitchdefault)|tweaks|checkstyle|Yes|
|
||||||
[ModifiedControlVariable](#modifiedcontrolvariable)|tweaks|checkstyle|Yes|
|
[ModifiedControlVariable](#modifiedcontrolvariable)|tweaks|checkstyle|Yes|
|
||||||
[ModifierOrder](#modifierorder)|naming|checkstyle|Yes|
|
[ModifierOrder](#modifierorder)|naming|checkstyle|Yes|
|
||||||
|
[MoveVariableInsideIfCheck](#movevariableinsideifcheck)|tweaks|sevntu|Yes|
|
||||||
[MultipleStringLiterals](#multiplestringliterals)|naming|checkstyle|Yes|
|
[MultipleStringLiterals](#multiplestringliterals)|naming|checkstyle|Yes|
|
||||||
[MultipleVariableDeclarations](#multiplevariabledeclarations)|naming|checkstyle|Yes|
|
[MultipleVariableDeclarations](#multiplevariabledeclarations)|naming|checkstyle|Yes|
|
||||||
[MutableException](#mutableexception)|tweaks|checkstyle|Yes|
|
[MutableException](#mutableexception)|tweaks|checkstyle|Yes|
|
||||||
|
@ -910,13 +903,15 @@ Checks that when a class overrides the `equals()` method, that it also overrides
|
||||||
Limits the number of executable statements in a method to 30.
|
Limits the number of executable statements in a method to 30.
|
||||||
#### [ExplicitInitialization](http://checkstyle.sourceforge.net/config_coding.html#ExplicitInitialization)
|
#### [ExplicitInitialization](http://checkstyle.sourceforge.net/config_coding.html#ExplicitInitialization)
|
||||||
|
|
||||||
Checks that fields are not being explicitly initialised to their already default value.
|
Checks that object fields are not being explicitly initialised to their already default value.
|
||||||
|
|
||||||
|
Does not check primitive field types.
|
||||||
|
|
||||||
Valid:
|
Valid:
|
||||||
````
|
````
|
||||||
class Valid {
|
class Valid {
|
||||||
|
|
||||||
private int foo;
|
private int foo = 0;
|
||||||
|
|
||||||
private Object bar;
|
private Object bar;
|
||||||
}
|
}
|
||||||
|
@ -926,7 +921,7 @@ Invalid:
|
||||||
````
|
````
|
||||||
class Invalid {
|
class Invalid {
|
||||||
|
|
||||||
private int foo = 0;
|
private Integer foo = 0;
|
||||||
|
|
||||||
private Object bar = null;
|
private Object bar = null;
|
||||||
}
|
}
|
||||||
|
@ -2264,32 +2259,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`.
|
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)
|
#### [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.
|
Checks that Enum Values match the pattern: `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Valid:
|
Valid:
|
||||||
````
|
````
|
||||||
enum ValidConstants {
|
enum Valid {
|
||||||
|
|
||||||
ALPHA, BETA;
|
ALPHA, BETA, GAMMA_RAY;
|
||||||
}
|
|
||||||
|
|
||||||
enum ValidClassLike {
|
|
||||||
|
|
||||||
Alpha("a"),
|
|
||||||
Beta("b");
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
ValidClassLike(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
|
@ -2297,19 +2273,7 @@ Invalid:
|
||||||
````
|
````
|
||||||
enum InvalidConstants {
|
enum InvalidConstants {
|
||||||
|
|
||||||
alpha, Beta, GAMMA_RAY;
|
alpha, Beta;
|
||||||
}
|
|
||||||
|
|
||||||
enum InvalidClassLike {
|
|
||||||
|
|
||||||
alpha("a"),
|
|
||||||
beta("b");
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
InvalidClassLike(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
#### [ForbidCCommentsInMethods](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/ForbidCCommentsInMethodsCheck.html)
|
#### [ForbidCCommentsInMethods](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/ForbidCCommentsInMethodsCheck.html)
|
||||||
|
@ -2343,6 +2307,19 @@ try {
|
||||||
return true; // invalid
|
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)
|
#### [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.
|
Prevent the placement of variables or fields after methods in an expression.
|
||||||
|
@ -2359,6 +2336,29 @@ if (getProperty() && property) {}
|
||||||
#### [MapIterationInForEachLoop](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/MapIterationInForEachLoopCheck.html)
|
#### [MapIterationInForEachLoop](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/MapIterationInForEachLoopCheck.html)
|
||||||
|
|
||||||
Checks for unoptimised iterations over `Map`s. Check use of `map.values()`, `map.keySet()` and `map.entrySet()` against the use of the iterator produced to verify if another could be better.
|
Checks for unoptimised iterations over `Map`s. Check use of `map.values()`, `map.keySet()` and `map.entrySet()` against the use of the iterator produced to verify if another could be better.
|
||||||
|
#### [MoveVariableInsideIfCheck](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/MoveVariableInsideIfCheck.html)
|
||||||
|
|
||||||
|
Checks if a variable is declared outside an `if` block that is only used within that block.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````
|
||||||
|
if (condition) {
|
||||||
|
String variable = input.substring(1);
|
||||||
|
return method(variable);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````
|
||||||
|
String variable = input.substring(1);
|
||||||
|
if (condition) {
|
||||||
|
return method(variable);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
````
|
||||||
|
|
||||||
|
Example: [MoveVariableInsideIf.java](https://github.com/kemitix/kemitix-checkstyle-ruleset/blob/master/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java)
|
||||||
#### [NameConventionForJunit4TestClasses](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/NameConventionForJunit4TestClassesCheck.html)
|
#### [NameConventionForJunit4TestClasses](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/NameConventionForJunit4TestClassesCheck.html)
|
||||||
|
|
||||||
Checks the names of JUnit test classes. Classes checked are those that have at least one method annotated with `Test` or `org.junit.Test`.
|
Checks the names of JUnit test classes. Classes checked are those that have at least one method annotated with `Test` or `org.junit.Test`.
|
||||||
|
@ -2703,9 +2703,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)
|
#### [ForbidThrowAnonymousExceptions](http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/ForbidThrowAnonymousExceptionsCheck.html)
|
||||||
|
|
||||||
[IllegalThrows](#illegalthrows) performs a similar check.
|
[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)
|
#### [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.
|
Generic rule; doesn't embody a 'quality' check.
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>kemitix-checkstyle-ruleset-builder</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-builder</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>Kemitix Checkstyle Ruleset Builder</name>
|
<name>Kemitix Checkstyle Ruleset Builder</name>
|
||||||
|
@ -42,6 +42,8 @@
|
||||||
<mapstream.version>2.3.5</mapstream.version>
|
<mapstream.version>2.3.5</mapstream.version>
|
||||||
<map-builder.version>1.0.0</map-builder.version>
|
<map-builder.version>1.0.0</map-builder.version>
|
||||||
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
|
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
|
||||||
|
<checkstyle.version>7.8</checkstyle.version>
|
||||||
|
<sevntu.version>1.24.0</sevntu.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -92,6 +94,19 @@
|
||||||
<version>${map-builder.version}</version>
|
<version>${map-builder.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.puppycrawl.tools</groupId>
|
||||||
|
<artifactId>checkstyle</artifactId>
|
||||||
|
<version>${checkstyle.version}</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.sevntu-checkstyle</groupId>
|
||||||
|
<artifactId>sevntu-checks</artifactId>
|
||||||
|
<version>${sevntu.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import com.google.common.reflect.ClassPath;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration for Builder.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class BuilderConfiguration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the ClassPath used to scan packages.
|
||||||
|
*
|
||||||
|
* @return the ClassPath
|
||||||
|
*
|
||||||
|
* @throws IOException if there is an error
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public ClassPath classPath() throws IOException {
|
||||||
|
return ClassPath.from(getClass().getClassLoader());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raised when a Class to implement a Rule is not found.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
public class CheckstyleClassNotFoundException extends RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param name the name of the unimplemented rule
|
||||||
|
*/
|
||||||
|
public CheckstyleClassNotFoundException(final String name) {
|
||||||
|
super("No class found to implement " + name);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raised when there is an error scanning for check classes.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
public class CheckstyleSourceLoadException extends RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param basePackage the base package classes were being loaded from
|
||||||
|
* @param cause the cause
|
||||||
|
*/
|
||||||
|
public CheckstyleSourceLoadException(final String basePackage, final IOException cause) {
|
||||||
|
super("Error loading checkstyle rules from package: " + basePackage, cause);
|
||||||
|
}
|
||||||
|
}
|
|
@ -55,6 +55,8 @@ class CheckstyleWriter implements CommandLineRunner {
|
||||||
|
|
||||||
private final RulesProperties rulesProperties;
|
private final RulesProperties rulesProperties;
|
||||||
|
|
||||||
|
private final RuleClassLocator ruleClassLocator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(final String... args) throws Exception {
|
public void run(final String... args) throws Exception {
|
||||||
Stream.of(RuleLevel.values())
|
Stream.of(RuleLevel.values())
|
||||||
|
@ -91,19 +93,19 @@ class CheckstyleWriter implements CommandLineRunner {
|
||||||
log.info("Writing xmlFile: {}", xmlFile);
|
log.info("Writing xmlFile: {}", xmlFile);
|
||||||
Files.write(xmlFile, output, StandardCharsets.UTF_8);
|
Files.write(xmlFile, output, StandardCharsets.UTF_8);
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Missing template: " + checkstyleXmlTemplate.toString());
|
throw new TemplateNotFoundException(checkstyleXmlTemplate);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new CheckstyleWriterException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String formatRuleAsModule(final Rule rule) {
|
private String formatRuleAsModule(final Rule rule) {
|
||||||
if (rule.getProperties()
|
if (rule.getProperties()
|
||||||
.isEmpty()) {
|
.isEmpty()) {
|
||||||
return String.format("<module name=\"%s\"/>", rule.getName());
|
return String.format("<module name=\"%s\"/>", ruleClassLocator.apply(rule));
|
||||||
}
|
}
|
||||||
return String.format("<module name=\"%s\">%n %s%n</module>", rule.getName(),
|
return String.format("<module name=\"%s\">%n %s%n</module>", ruleClassLocator.apply(rule),
|
||||||
formatProperties(rule.getProperties())
|
formatProperties(rule.getProperties())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raised when there was an error writing a Checkstyle ruleset.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
class CheckstyleWriterException extends RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param cause the cause
|
||||||
|
*/
|
||||||
|
CheckstyleWriterException(final Throwable cause) {
|
||||||
|
super(cause);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import com.google.common.reflect.ClassPath;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default implementation of {@link PackageScanner}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DefaultPackageScanner implements PackageScanner {
|
||||||
|
|
||||||
|
private final ClassPath classPath;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final Stream<String> apply(final RuleSource ruleSource) {
|
||||||
|
return classPath.getTopLevelClassesRecursive(ruleSource.getBasePackage())
|
||||||
|
.stream()
|
||||||
|
.map(ClassPath.ClassInfo::getName);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,77 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import java.util.AbstractMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default implementation of {@link RuleClassLocator}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DefaultRuleClassLocator implements RuleClassLocator {
|
||||||
|
|
||||||
|
private final PackageScanner packageScanner;
|
||||||
|
|
||||||
|
private Map<RuleSource, List<String>> checkClasses;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise class lists for {@link RuleSource}s.
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public final void init() {
|
||||||
|
checkClasses = Stream.of(RuleSource.values())
|
||||||
|
.map(source -> new AbstractMap.SimpleEntry<>(
|
||||||
|
source, packageScanner.apply(source)
|
||||||
|
.collect(Collectors.toList())))
|
||||||
|
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final String apply(final Rule rule) {
|
||||||
|
return getCanonicalClassName(rule.getSource(), rule.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getCanonicalClassName(final RuleSource source, final String name) {
|
||||||
|
return checkClasses.get(source)
|
||||||
|
.stream()
|
||||||
|
.sorted()
|
||||||
|
.filter(classname -> byRuleName(classname, name))
|
||||||
|
.findFirst()
|
||||||
|
.orElseThrow(() -> new CheckstyleClassNotFoundException(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean byRuleName(final String classname, final String name) {
|
||||||
|
final String classNameWithDelimiter = "." + name;
|
||||||
|
return classname.endsWith(classNameWithDelimiter) || classname.endsWith(classNameWithDelimiter + "Check");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scans a package for all classes.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
interface PackageScanner extends Function<RuleSource, Stream<String>> {
|
||||||
|
|
||||||
|
}
|
|
@ -40,6 +40,11 @@ public class Rule {
|
||||||
|
|
||||||
private static final Locale LOCALE = Locale.ENGLISH;
|
private static final Locale LOCALE = Locale.ENGLISH;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configuration properties.
|
||||||
|
*/
|
||||||
|
private final Map<String, String> properties = new HashMap<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The name of the rule's Check class.
|
* The name of the rule's Check class.
|
||||||
*/
|
*/
|
||||||
|
@ -80,11 +85,6 @@ public class Rule {
|
||||||
*/
|
*/
|
||||||
private String reason;
|
private String reason;
|
||||||
|
|
||||||
/**
|
|
||||||
* Configuration properties.
|
|
||||||
*/
|
|
||||||
private final Map<String, String> properties = new HashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare two Rules lexicographically for sorting by rule name, ignoring case.
|
* Compare two Rules lexicographically for sorting by rule name, ignoring case.
|
||||||
*
|
*
|
||||||
|
@ -95,7 +95,7 @@ public class Rule {
|
||||||
* the right string; and a value greater than 0 if the left string is lexicographically greater than the right
|
* the right string; and a value greater than 0 if the left string is lexicographically greater than the right
|
||||||
* string.
|
* string.
|
||||||
*/
|
*/
|
||||||
static int sortByName(final Rule left, final Rule right) {
|
protected static int sortByName(final Rule left, final Rule right) {
|
||||||
return left.getLowerCaseRuleName()
|
return left.getLowerCaseRuleName()
|
||||||
.compareTo(right.getLowerCaseRuleName());
|
.compareTo(right.getLowerCaseRuleName());
|
||||||
}
|
}
|
||||||
|
@ -103,5 +103,4 @@ public class Rule {
|
||||||
private String getLowerCaseRuleName() {
|
private String getLowerCaseRuleName() {
|
||||||
return getName().toLowerCase(LOCALE);
|
return getName().toLowerCase(LOCALE);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the canonical name of the class that implements a {@link Rule}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
interface RuleClassLocator extends Function<Rule, String> {
|
||||||
|
|
||||||
|
}
|
|
@ -21,6 +21,8 @@
|
||||||
|
|
||||||
package net.kemitix.checkstyle.ruleset.builder;
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The origin of the rule.
|
* The origin of the rule.
|
||||||
*
|
*
|
||||||
|
@ -28,6 +30,19 @@ package net.kemitix.checkstyle.ruleset.builder;
|
||||||
*/
|
*/
|
||||||
public enum RuleSource {
|
public enum RuleSource {
|
||||||
|
|
||||||
CHECKSTYLE,
|
CHECKSTYLE("com.puppycrawl.tools.checkstyle"),
|
||||||
SEVNTU,
|
SEVNTU("com.github.sevntu.checkstyle.checks");
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private final String basePackage;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param basePackage the base package that contains all checks from this source
|
||||||
|
*/
|
||||||
|
RuleSource(final String basePackage) {
|
||||||
|
this.basePackage = basePackage;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raised when a rule template is not found.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
class TemplateNotFoundException extends RuntimeException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param template the missing template
|
||||||
|
*/
|
||||||
|
TemplateNotFoundException(final Path template) {
|
||||||
|
super("Missing template: " + template.toString());
|
||||||
|
}
|
||||||
|
}
|
|
@ -66,19 +66,11 @@ The level is now specified as a configuration parameter. See the example below.
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</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
|
## All Checks
|
||||||
|
|
||||||
Rule|Level|Source|Enabled|Suppressable
|
Rule|Level|Source|Enabled|Suppressible
|
||||||
----|-----|------|-------|------------
|
----|-----|------|-------|------------
|
||||||
%s
|
%s
|
||||||
|
|
||||||
|
|
|
@ -275,6 +275,8 @@ rules:
|
||||||
enabled: true
|
enabled: true
|
||||||
source: CHECKSTYLE
|
source: CHECKSTYLE
|
||||||
uri: http://checkstyle.sourceforge.net/config_coding.html#ExplicitInitialization
|
uri: http://checkstyle.sourceforge.net/config_coding.html#ExplicitInitialization
|
||||||
|
properties:
|
||||||
|
onlyObjectReferences: true
|
||||||
-
|
-
|
||||||
name: FallThrough
|
name: FallThrough
|
||||||
parent: TREEWALKER
|
parent: TREEWALKER
|
||||||
|
@ -1056,10 +1058,9 @@ rules:
|
||||||
name: ForbidWildcardAsReturnType
|
name: ForbidWildcardAsReturnType
|
||||||
parent: TREEWALKER
|
parent: TREEWALKER
|
||||||
level: COMPLEXITY
|
level: COMPLEXITY
|
||||||
enabled: false
|
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
|
||||||
reason: Causes `NullPointerException` when used with `@Value.Immutables` from `org.immutables:value`
|
|
||||||
-
|
-
|
||||||
name: LogicConditionNeedOptimization
|
name: LogicConditionNeedOptimization
|
||||||
parent: TREEWALKER
|
parent: TREEWALKER
|
||||||
|
@ -1499,3 +1500,10 @@ rules:
|
||||||
source: SEVNTU
|
source: SEVNTU
|
||||||
uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/WhitespaceBeforeArrayInitializerCheck.html
|
uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/WhitespaceBeforeArrayInitializerCheck.html
|
||||||
reason: "TODO: enable"
|
reason: "TODO: enable"
|
||||||
|
-
|
||||||
|
name: MoveVariableInsideIfCheck
|
||||||
|
parent: TREEWALKER
|
||||||
|
level: TWEAKS
|
||||||
|
enabled: true
|
||||||
|
source: SEVNTU
|
||||||
|
uri: http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/MoveVariableInsideIfCheck.html
|
||||||
|
|
|
@ -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.
|
Checks that Enum Values match the pattern: `^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$`
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Valid:
|
Valid:
|
||||||
````
|
````
|
||||||
enum ValidConstants {
|
enum Valid {
|
||||||
|
|
||||||
ALPHA, BETA;
|
ALPHA, BETA, GAMMA_RAY;
|
||||||
}
|
|
||||||
|
|
||||||
enum ValidClassLike {
|
|
||||||
|
|
||||||
Alpha("a"),
|
|
||||||
Beta("b");
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
ValidClassLike(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
||||||
|
@ -32,18 +13,6 @@ Invalid:
|
||||||
````
|
````
|
||||||
enum InvalidConstants {
|
enum InvalidConstants {
|
||||||
|
|
||||||
alpha, Beta, GAMMA_RAY;
|
alpha, Beta;
|
||||||
}
|
|
||||||
|
|
||||||
enum InvalidClassLike {
|
|
||||||
|
|
||||||
alpha("a"),
|
|
||||||
beta("b");
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
InvalidClassLike(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
|
|
||||||
Checks that fields are not being explicitly initialised to their already default value.
|
Checks that object fields are not being explicitly initialised to their already default value.
|
||||||
|
|
||||||
|
Does not check primitive field types.
|
||||||
|
|
||||||
Valid:
|
Valid:
|
||||||
````
|
````
|
||||||
class Valid {
|
class Valid {
|
||||||
|
|
||||||
private int foo;
|
private int foo = 0;
|
||||||
|
|
||||||
private Object bar;
|
private Object bar;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +17,7 @@ Invalid:
|
||||||
````
|
````
|
||||||
class Invalid {
|
class Invalid {
|
||||||
|
|
||||||
private int foo = 0;
|
private Integer foo = 0;
|
||||||
|
|
||||||
private Object bar = null;
|
private Object bar = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
|
||||||
|
Checks if a variable is declared outside an `if` block that is only used within that block.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````
|
||||||
|
if (condition) {
|
||||||
|
String variable = input.substring(1);
|
||||||
|
return method(variable);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````
|
||||||
|
String variable = input.substring(1);
|
||||||
|
if (condition) {
|
||||||
|
return method(variable);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
````
|
||||||
|
|
||||||
|
Example: [MoveVariableInsideIf.java](https://github.com/kemitix/kemitix-checkstyle-ruleset/blob/master/regressions/src/main/java/net/kemitix/checkstyle/regressions/MoveVariableInsideIf.java)
|
|
@ -0,0 +1,24 @@
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import com.google.common.reflect.ClassPath;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link BuilderConfiguration}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
public class BuilderConfigurationTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canGetClassPath() throws IOException {
|
||||||
|
//when
|
||||||
|
final ClassPath classPath = new BuilderConfiguration().classPath();
|
||||||
|
//then
|
||||||
|
assertThat(classPath).isNotNull();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link CheckstyleClassNotFoundException}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
public class CheckstyleClassNotFoundExceptionTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canRaiseException() {
|
||||||
|
//given
|
||||||
|
final String classname = "class name";
|
||||||
|
//when
|
||||||
|
final CheckstyleClassNotFoundException exception = new CheckstyleClassNotFoundException(classname);
|
||||||
|
//then
|
||||||
|
assertThat(exception.getMessage()).startsWith("No class found to implement ")
|
||||||
|
.endsWith(classname);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link CheckstyleSourceLoadException}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
public class CheckstyleSourceLoadExceptionTest {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canRaiseException() {
|
||||||
|
//given
|
||||||
|
final String basePackage = "base package";
|
||||||
|
final IOException cause = new IOException();
|
||||||
|
//when
|
||||||
|
final CheckstyleSourceLoadException exception = new CheckstyleSourceLoadException(basePackage, cause);
|
||||||
|
//then
|
||||||
|
assertThat(exception).hasCause(cause)
|
||||||
|
.hasMessageStartingWith("Error loading checkstyle rules from package: ")
|
||||||
|
.hasMessageEndingWith(basePackage);
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,10 +2,12 @@ package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
import lombok.val;
|
import lombok.val;
|
||||||
import me.andrz.builder.map.MapBuilder;
|
import me.andrz.builder.map.MapBuilder;
|
||||||
|
import org.assertj.core.api.ThrowableAssert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.rules.ExpectedException;
|
import org.junit.rules.ExpectedException;
|
||||||
import org.junit.rules.TemporaryFolder;
|
import org.junit.rules.TemporaryFolder;
|
||||||
|
import org.mockito.Mock;
|
||||||
import org.mockito.MockitoAnnotations;
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -17,9 +19,11 @@ import java.nio.file.StandardOpenOption;
|
||||||
import java.util.AbstractMap;
|
import java.util.AbstractMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||||
|
import static org.mockito.BDDMockito.given;
|
||||||
|
import static org.mockito.Matchers.any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests for {@link CheckstyleWriter}.
|
* Tests for {@link CheckstyleWriter}.
|
||||||
|
@ -32,6 +36,12 @@ public class CheckstyleWriterTest {
|
||||||
|
|
||||||
private static final String FILE_SEPARATOR = System.getProperty("file.separator");
|
private static final String FILE_SEPARATOR = System.getProperty("file.separator");
|
||||||
|
|
||||||
|
@org.junit.Rule
|
||||||
|
public ExpectedException exception = ExpectedException.none();
|
||||||
|
|
||||||
|
@org.junit.Rule
|
||||||
|
public TemporaryFolder folder = new TemporaryFolder();
|
||||||
|
|
||||||
private CheckstyleWriter checkstyleWriter;
|
private CheckstyleWriter checkstyleWriter;
|
||||||
|
|
||||||
private OutputProperties outputProperties;
|
private OutputProperties outputProperties;
|
||||||
|
@ -42,23 +52,20 @@ public class CheckstyleWriterTest {
|
||||||
|
|
||||||
private String ruleName;
|
private String ruleName;
|
||||||
|
|
||||||
|
private String ruleClassname;
|
||||||
|
|
||||||
private Map<RuleLevel, String> outputFiles;
|
private Map<RuleLevel, String> outputFiles;
|
||||||
|
|
||||||
private Path outputDirectory;
|
private Path outputDirectory;
|
||||||
|
|
||||||
private Path checkstyleTemplate;
|
@Mock
|
||||||
|
private RuleClassLocator ruleClassLocator;
|
||||||
@org.junit.Rule
|
|
||||||
public ExpectedException exception = ExpectedException.none();
|
|
||||||
|
|
||||||
@org.junit.Rule
|
|
||||||
public TemporaryFolder folder = new TemporaryFolder();
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
ruleName = UUID.randomUUID()
|
ruleName = "RegexpOnFilename";
|
||||||
.toString();
|
ruleClassname = "com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck";
|
||||||
outputProperties = new OutputProperties();
|
outputProperties = new OutputProperties();
|
||||||
outputFiles = new MapBuilder<RuleLevel, String>().put(getOutputFile(RuleLevel.LAYOUT))
|
outputFiles = new MapBuilder<RuleLevel, String>().put(getOutputFile(RuleLevel.LAYOUT))
|
||||||
.put(getOutputFile(RuleLevel.NAMING))
|
.put(getOutputFile(RuleLevel.NAMING))
|
||||||
|
@ -71,13 +78,20 @@ public class CheckstyleWriterTest {
|
||||||
.toPath();
|
.toPath();
|
||||||
outputProperties.setDirectory(outputDirectory);
|
outputProperties.setDirectory(outputDirectory);
|
||||||
templateProperties = new TemplateProperties();
|
templateProperties = new TemplateProperties();
|
||||||
checkstyleTemplate = folder.newFile("checkstyle-template.xml")
|
val checkstyleTemplate = folder.newFile("checkstyle-template.xml")
|
||||||
.toPath();
|
.toPath();
|
||||||
Files.write(
|
Files.write(
|
||||||
checkstyleTemplate, TEMPLATE.getBytes(StandardCharsets.UTF_8), StandardOpenOption.TRUNCATE_EXISTING);
|
checkstyleTemplate, TEMPLATE.getBytes(StandardCharsets.UTF_8), StandardOpenOption.TRUNCATE_EXISTING);
|
||||||
templateProperties.setCheckstyleXml(checkstyleTemplate);
|
templateProperties.setCheckstyleXml(checkstyleTemplate);
|
||||||
rulesProperties = new RulesProperties();
|
rulesProperties = new RulesProperties();
|
||||||
checkstyleWriter = new CheckstyleWriter(outputProperties, templateProperties, rulesProperties);
|
checkstyleWriter =
|
||||||
|
new CheckstyleWriter(outputProperties, templateProperties, rulesProperties, ruleClassLocator);
|
||||||
|
given(ruleClassLocator.apply(any())).willReturn(ruleClassname);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map.Entry<RuleLevel, String> getOutputFile(final RuleLevel level) throws IOException {
|
||||||
|
final String xmlFile = String.format("checkstyle-%s.xml", level.toString());
|
||||||
|
return new AbstractMap.SimpleImmutableEntry<>(level, xmlFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// write rule that matches current level
|
// write rule that matches current level
|
||||||
|
@ -91,7 +105,24 @@ public class CheckstyleWriterTest {
|
||||||
checkstyleWriter.run();
|
checkstyleWriter.run();
|
||||||
//then
|
//then
|
||||||
val lines = loadOutputFile(RuleLevel.LAYOUT);
|
val lines = loadOutputFile(RuleLevel.LAYOUT);
|
||||||
assertThat(lines).containsExactly("C:", String.format("TW:<module name=\"%s\"/>", ruleName));
|
assertThat(lines).containsExactly("C:", String.format("TW:<module name=\"%s\"/>", ruleClassname));
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> loadOutputFile(final RuleLevel level) throws IOException {
|
||||||
|
val path = outputDirectory.resolve(outputFiles.get(level));
|
||||||
|
assertThat(path).as("Output path exists")
|
||||||
|
.exists();
|
||||||
|
return Files.readAllLines(path, StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Rule enabledRule(final RuleLevel level, final RuleParent parent) {
|
||||||
|
val rule = new Rule();
|
||||||
|
rule.setName(ruleName);
|
||||||
|
rule.setSource(RuleSource.CHECKSTYLE);
|
||||||
|
rule.setEnabled(true);
|
||||||
|
rule.setLevel(level);
|
||||||
|
rule.setParent(parent);
|
||||||
|
return rule;
|
||||||
}
|
}
|
||||||
|
|
||||||
// write rule that is below current level
|
// write rule that is below current level
|
||||||
|
@ -105,7 +136,7 @@ public class CheckstyleWriterTest {
|
||||||
checkstyleWriter.run();
|
checkstyleWriter.run();
|
||||||
//then
|
//then
|
||||||
val lines = loadOutputFile(RuleLevel.NAMING);
|
val lines = loadOutputFile(RuleLevel.NAMING);
|
||||||
assertThat(lines).containsExactly("C:", String.format("TW:<module name=\"%s\"/>", ruleName));
|
assertThat(lines).containsExactly("C:", String.format("TW:<module name=\"%s\"/>", ruleClassname));
|
||||||
}
|
}
|
||||||
|
|
||||||
// write rule with checker parent
|
// write rule with checker parent
|
||||||
|
@ -119,7 +150,7 @@ public class CheckstyleWriterTest {
|
||||||
checkstyleWriter.run();
|
checkstyleWriter.run();
|
||||||
//then
|
//then
|
||||||
val lines = loadOutputFile(RuleLevel.LAYOUT);
|
val lines = loadOutputFile(RuleLevel.LAYOUT);
|
||||||
assertThat(lines).containsExactly(String.format("C:<module name=\"%s\"/>", ruleName), "TW:");
|
assertThat(lines).containsExactly(String.format("C:<module name=\"%s\"/>", ruleClassname), "TW:");
|
||||||
}
|
}
|
||||||
|
|
||||||
// write rule with properties
|
// write rule with properties
|
||||||
|
@ -135,7 +166,7 @@ public class CheckstyleWriterTest {
|
||||||
checkstyleWriter.run();
|
checkstyleWriter.run();
|
||||||
//then
|
//then
|
||||||
val lines = loadOutputFile(RuleLevel.LAYOUT);
|
val lines = loadOutputFile(RuleLevel.LAYOUT);
|
||||||
assertThat(lines).containsExactly("C:", String.format("TW:<module name=\"%s\">", ruleName),
|
assertThat(lines).containsExactly("C:", String.format("TW:<module name=\"%s\">", ruleClassname),
|
||||||
" <property name=\"key\" value=\"value\"/>", "</module>"
|
" <property name=\"key\" value=\"value\"/>", "</module>"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -173,10 +204,11 @@ public class CheckstyleWriterTest {
|
||||||
public void throwRteIfTemplateNotFound() throws Exception {
|
public void throwRteIfTemplateNotFound() throws Exception {
|
||||||
//given
|
//given
|
||||||
templateProperties.setCheckstyleXml(Paths.get("garbage"));
|
templateProperties.setCheckstyleXml(Paths.get("garbage"));
|
||||||
exception.expect(RuntimeException.class);
|
|
||||||
exception.expectMessage("Missing template: garbage");
|
|
||||||
//when
|
//when
|
||||||
checkstyleWriter.run();
|
final ThrowableAssert.ThrowingCallable action = () -> checkstyleWriter.run();
|
||||||
|
//then
|
||||||
|
assertThatThrownBy(action).isInstanceOf(TemplateNotFoundException.class)
|
||||||
|
.hasMessage("Missing template: garbage");
|
||||||
}
|
}
|
||||||
|
|
||||||
// throw RTE if error writing file
|
// throw RTE if error writing file
|
||||||
|
@ -185,31 +217,13 @@ public class CheckstyleWriterTest {
|
||||||
//given
|
//given
|
||||||
final String imaginary = String.join(FILE_SEPARATOR, "", "..", "imaginary");
|
final String imaginary = String.join(FILE_SEPARATOR, "", "..", "imaginary");
|
||||||
outputProperties.setDirectory(Paths.get(imaginary));
|
outputProperties.setDirectory(Paths.get(imaginary));
|
||||||
exception.expect(RuntimeException.class);
|
|
||||||
exception.expectMessage(
|
|
||||||
"java.nio.file.NoSuchFileException: " + imaginary + FILE_SEPARATOR + "checkstyle-LAYOUT.xml");
|
|
||||||
//when
|
//when
|
||||||
checkstyleWriter.run();
|
final ThrowableAssert.ThrowingCallable action = () -> checkstyleWriter.run();
|
||||||
}
|
//then
|
||||||
|
assertThatThrownBy(action).isInstanceOf(CheckstyleWriterException.class)
|
||||||
private Map.Entry<RuleLevel, String> getOutputFile(final RuleLevel level) throws IOException {
|
.hasMessage(
|
||||||
final String xmlFile = String.format("checkstyle-%s.xml", level.toString());
|
String.format("java.nio.file.NoSuchFileException: %scheckstyle-LAYOUT.xml",
|
||||||
return new AbstractMap.SimpleImmutableEntry<>(level, xmlFile);
|
imaginary + FILE_SEPARATOR
|
||||||
}
|
));
|
||||||
|
|
||||||
private List<String> loadOutputFile(final RuleLevel level) throws IOException {
|
|
||||||
val path = outputDirectory.resolve(outputFiles.get(level));
|
|
||||||
assertThat(path).as("Output path exists")
|
|
||||||
.exists();
|
|
||||||
return Files.readAllLines(path, StandardCharsets.UTF_8);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Rule enabledRule(final RuleLevel level, final RuleParent parent) {
|
|
||||||
val rule = new Rule();
|
|
||||||
rule.setName(ruleName);
|
|
||||||
rule.setEnabled(true);
|
|
||||||
rule.setLevel(level);
|
|
||||||
rule.setParent(parent);
|
|
||||||
return rule;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import com.google.common.reflect.ClassPath;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link DefaultPackageScanner}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
public class DefaultPackageScannerTest {
|
||||||
|
|
||||||
|
private DefaultPackageScanner scanner;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
final ClassPath classPath = ClassPath.from(getClass().getClassLoader());
|
||||||
|
scanner = new DefaultPackageScanner(classPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canScanCheckstylePackage() throws IOException {
|
||||||
|
//when
|
||||||
|
final Stream<String> result = scanner.apply(RuleSource.CHECKSTYLE);
|
||||||
|
//then
|
||||||
|
assertThat(result).allMatch(cn -> cn.startsWith(RuleSource.CHECKSTYLE.getBasePackage()))
|
||||||
|
.contains("com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canScanSevntuPackage() throws IOException {
|
||||||
|
//when
|
||||||
|
final Stream<String> result = scanner.apply(RuleSource.SEVNTU);
|
||||||
|
//then
|
||||||
|
assertThat(result).allMatch(cn -> cn.startsWith(RuleSource.SEVNTU.getBasePackage()))
|
||||||
|
.contains("com.github.sevntu.checkstyle.checks.design.NestedSwitchCheck");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import org.mockito.MockitoAnnotations;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.mockito.BDDMockito.given;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link DefaultRuleClassLocator}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
public class DefaultRuleClassLocatorTest {
|
||||||
|
|
||||||
|
private DefaultRuleClassLocator subject;
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private PackageScanner packageScanner;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() {
|
||||||
|
MockitoAnnotations.initMocks(this);
|
||||||
|
subject = new DefaultRuleClassLocator(packageScanner);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void canLookupRule() {
|
||||||
|
//given
|
||||||
|
final String rulename = "RegexpOnFilename";
|
||||||
|
final String expected = "com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck";
|
||||||
|
final List<String> checkstyleClasses = Collections.singletonList(expected);
|
||||||
|
final List<String> sevntuClasses = Collections.emptyList();
|
||||||
|
given(packageScanner.apply(RuleSource.CHECKSTYLE)).willReturn(checkstyleClasses.stream());
|
||||||
|
given(packageScanner.apply(RuleSource.SEVNTU)).willReturn(sevntuClasses.stream());
|
||||||
|
subject.init();
|
||||||
|
final Rule rule = createCheckstyleRule(rulename);
|
||||||
|
//when
|
||||||
|
final String result = subject.apply(rule);
|
||||||
|
//then
|
||||||
|
assertThat(result).isEqualTo(expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Rule createCheckstyleRule(final String rulename) {
|
||||||
|
final Rule rule = new Rule();
|
||||||
|
rule.setSource(RuleSource.CHECKSTYLE);
|
||||||
|
rule.setName(rulename);
|
||||||
|
return rule;
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,12 +23,8 @@ public class DefaultRuleReadmeLoaderTest {
|
||||||
|
|
||||||
private RuleReadmeLoader loader;
|
private RuleReadmeLoader loader;
|
||||||
|
|
||||||
private TemplateProperties templateProperties;
|
|
||||||
|
|
||||||
private Rule rule;
|
private Rule rule;
|
||||||
|
|
||||||
private Path fragment;
|
|
||||||
|
|
||||||
private Path fragments;
|
private Path fragments;
|
||||||
|
|
||||||
@org.junit.Rule
|
@org.junit.Rule
|
||||||
|
@ -39,7 +35,7 @@ public class DefaultRuleReadmeLoaderTest {
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
templateProperties = new TemplateProperties();
|
final TemplateProperties templateProperties = new TemplateProperties();
|
||||||
fragments = folder.newFolder("fragments")
|
fragments = folder.newFolder("fragments")
|
||||||
.toPath();
|
.toPath();
|
||||||
templateProperties.setReadmeFragments(fragments);
|
templateProperties.setReadmeFragments(fragments);
|
||||||
|
@ -53,8 +49,8 @@ public class DefaultRuleReadmeLoaderTest {
|
||||||
public void loadEnabledOkay() throws IOException {
|
public void loadEnabledOkay() throws IOException {
|
||||||
//given
|
//given
|
||||||
rule.setEnabled(true);
|
rule.setEnabled(true);
|
||||||
fragment = fragments.resolve("name.md");
|
final Path fragment1 = fragments.resolve("name.md");
|
||||||
Files.write(fragment, Arrays.asList("", "body"));
|
Files.write(fragment1, Arrays.asList("", "body"));
|
||||||
//when
|
//when
|
||||||
val fragment = loader.load(rule);
|
val fragment = loader.load(rule);
|
||||||
//then
|
//then
|
||||||
|
|
|
@ -25,10 +25,6 @@ public class ReadmeWriterTest {
|
||||||
|
|
||||||
private ReadmeWriter readmeWriter;
|
private ReadmeWriter readmeWriter;
|
||||||
|
|
||||||
private TemplateProperties templateProperties;
|
|
||||||
|
|
||||||
private OutputProperties outputProperties;
|
|
||||||
|
|
||||||
private RulesProperties rulesProperties;
|
private RulesProperties rulesProperties;
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
|
@ -37,10 +33,6 @@ public class ReadmeWriterTest {
|
||||||
@Mock
|
@Mock
|
||||||
private ReadmeIndexBuilder indexBuilder;
|
private ReadmeIndexBuilder indexBuilder;
|
||||||
|
|
||||||
private Path template;
|
|
||||||
|
|
||||||
private Path fragments;
|
|
||||||
|
|
||||||
private Path readme;
|
private Path readme;
|
||||||
|
|
||||||
@org.junit.Rule
|
@org.junit.Rule
|
||||||
|
@ -49,17 +41,17 @@ public class ReadmeWriterTest {
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
MockitoAnnotations.initMocks(this);
|
MockitoAnnotations.initMocks(this);
|
||||||
template = folder.newFile("README-template.md")
|
final Path template = folder.newFile("README-template.md")
|
||||||
.toPath();
|
.toPath();
|
||||||
Files.write(template, Arrays.asList("i:%s", "ce:%s", "se:%s", "cd:%s", "sd:%s"));
|
Files.write(template, Arrays.asList("i:%s", "ce:%s", "se:%s", "cd:%s", "sd:%s"));
|
||||||
fragments = folder.newFolder("fragments")
|
final TemplateProperties templateProperties = new TemplateProperties();
|
||||||
|
templateProperties.setReadmeTemplate(template);
|
||||||
|
final Path fragments = folder.newFolder("fragments")
|
||||||
.toPath();
|
.toPath();
|
||||||
|
templateProperties.setReadmeFragments(fragments);
|
||||||
|
final OutputProperties outputProperties = new OutputProperties();
|
||||||
readme = folder.newFile("README.md")
|
readme = folder.newFile("README.md")
|
||||||
.toPath();
|
.toPath();
|
||||||
templateProperties = new TemplateProperties();
|
|
||||||
templateProperties.setReadmeTemplate(template);
|
|
||||||
templateProperties.setReadmeFragments(fragments);
|
|
||||||
outputProperties = new OutputProperties();
|
|
||||||
outputProperties.setReadme(readme);
|
outputProperties.setReadme(readme);
|
||||||
rulesProperties = new RulesProperties();
|
rulesProperties = new RulesProperties();
|
||||||
readmeWriter =
|
readmeWriter =
|
||||||
|
|
|
@ -30,4 +30,16 @@ public class RuleSourceTest {
|
||||||
//then
|
//then
|
||||||
assertThat(values).containsExactlyElementsOf(expected);
|
assertThat(values).containsExactlyElementsOf(expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void basePackages() {
|
||||||
|
//given
|
||||||
|
final String puppycrawl = "puppycrawl";
|
||||||
|
final String sevntu = "sevntu";
|
||||||
|
//then
|
||||||
|
assertThat(RuleSource.CHECKSTYLE.getBasePackage()).contains(puppycrawl)
|
||||||
|
.doesNotContain(sevntu);
|
||||||
|
assertThat(RuleSource.SEVNTU.getBasePackage()).contains(sevntu)
|
||||||
|
.doesNotContain(puppycrawl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,18 +2,20 @@
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<properties>
|
||||||
|
<kemitix-checkstyle-ruleset.level>2-naming</kemitix-checkstyle-ruleset.level>
|
||||||
|
</properties>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.kemitix</groupId>
|
<groupId>net.kemitix</groupId>
|
||||||
<artifactId>kemitix-checkstyle-ruleset-sample-parent</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-sample-parent</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
<relativePath>../sample-parent</relativePath>
|
<relativePath>../sample-parent</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>kemitix-checkstyle-ruleset-plugin-sample</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-plugin-sample</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
|
|
||||||
<name>Kemitix Checkstyle Ruleset Plugin Sample</name>
|
<name>Kemitix Checkstyle Ruleset Plugin Sample</name>
|
||||||
<description>Sample usage of the Kemitix Checkstyle Ruleset Plugin</description>
|
<description>Sample usage of the Kemitix Checkstyle Ruleset Plugin</description>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.kemitix</groupId>
|
<groupId>net.kemitix</groupId>
|
||||||
<artifactId>kemitix-checkstyle-ruleset-parent</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-parent</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>kemitix-checkstyle-ruleset-maven-plugin</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-maven-plugin</artifactId>
|
||||||
|
@ -151,11 +151,4 @@
|
||||||
</plugin><!-- jacoco-maven-plugin -->
|
</plugin><!-- jacoco-maven-plugin -->
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<pluginRepositories>
|
|
||||||
<pluginRepository>
|
|
||||||
<id>sevntu-maven</id>
|
|
||||||
<name>sevntu-maven</name>
|
|
||||||
<url>http://sevntu-checkstyle.github.io/sevntu.checkstyle/maven2</url>
|
|
||||||
</pluginRepository>
|
|
||||||
</pluginRepositories>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class DefaultCheckstyleExecutor implements CheckstyleExecutor {
|
||||||
|
|
||||||
private static final String CHECKSTYLE_ARTIFACTID = "checkstyle";
|
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";
|
private static final String SEVNTU_ARTIFACTID = "sevntu-checkstyle-maven-plugin";
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,6 @@ public class DefaultCheckstyleExecutorTest {
|
||||||
@Mock
|
@Mock
|
||||||
private Artifact artifact;
|
private Artifact artifact;
|
||||||
|
|
||||||
private File artifactFile;
|
|
||||||
|
|
||||||
@Mock
|
@Mock
|
||||||
private MavenXpp3Reader mavenXpp3Reader;
|
private MavenXpp3Reader mavenXpp3Reader;
|
||||||
|
|
||||||
|
@ -122,8 +120,8 @@ public class DefaultCheckstyleExecutorTest {
|
||||||
.level(level)
|
.level(level)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
artifactFile = folder.newFile("pom.xml");
|
|
||||||
given(artifactRepository.find(any())).willReturn(artifact);
|
given(artifactRepository.find(any())).willReturn(artifact);
|
||||||
|
final File artifactFile = folder.newFile("pom.xml");
|
||||||
given(artifact.getFile()).willReturn(artifactFile);
|
given(artifact.getFile()).willReturn(artifactFile);
|
||||||
given(mavenXpp3Reader.read(any(FileReader.class))).willReturn(pomModel);
|
given(mavenXpp3Reader.read(any(FileReader.class))).willReturn(pomModel);
|
||||||
final Properties properties = new Properties();
|
final Properties properties = new Properties();
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>net.kemitix</groupId>
|
<groupId>net.kemitix</groupId>
|
||||||
<artifactId>kemitix-checkstyle-ruleset-parent</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-parent</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<name>Kemitix Checkstyle Ruleset (Parent)</name>
|
<name>Kemitix Checkstyle Ruleset (Parent)</name>
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
|
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
|
||||||
|
|
||||||
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
|
<maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
|
||||||
<checkstyle.version>7.6.1</checkstyle.version>
|
<checkstyle.version>7.8</checkstyle.version>
|
||||||
<sevntu.version>1.23.1</sevntu.version>
|
<sevntu.version>1.24.0</sevntu.version>
|
||||||
<mockito.version>1.10.19</mockito.version>
|
<mockito.version>1.10.19</mockito.version>
|
||||||
<assertj.version>3.8.0</assertj.version>
|
<assertj.version>3.8.0</assertj.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>kemitix-checkstyle-ruleset-sample-parent</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-sample-parent</artifactId>
|
||||||
<groupId>net.kemitix</groupId>
|
<groupId>net.kemitix</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
<relativePath>../sample-parent</relativePath>
|
<relativePath>../sample-parent</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.regressions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regression demo for {@code ExplicitInitializationCheck}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net).
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("hideutilityclassconstructor")
|
||||||
|
class ExplicitInitialization {
|
||||||
|
|
||||||
|
private boolean validBoolean = false;
|
||||||
|
|
||||||
|
private int validInt = 0;
|
||||||
|
|
||||||
|
private String validString = "";
|
||||||
|
|
||||||
|
private Object validObject = new Object();
|
||||||
|
|
||||||
|
@SuppressWarnings("explicitinitialization")
|
||||||
|
private Boolean invalidBoolean = null;
|
||||||
|
|
||||||
|
@SuppressWarnings("explicitinitialization")
|
||||||
|
private Integer invalidInteger = null;
|
||||||
|
|
||||||
|
@SuppressWarnings("explicitinitialization")
|
||||||
|
private String invalidString = null;
|
||||||
|
|
||||||
|
@SuppressWarnings("explicitinitialization")
|
||||||
|
private Object invalidObject = null;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,65 @@
|
||||||
|
/**
|
||||||
|
* The MIT License (MIT)
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 Paul Campbell
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
||||||
|
* and associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||||
|
* including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
* subject to the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be included in all copies
|
||||||
|
* or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package net.kemitix.checkstyle.regressions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regression demo for {@code MoveVariableInsideIfCheck}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
class MoveVariableInsideIf {
|
||||||
|
|
||||||
|
private String input = "1";
|
||||||
|
|
||||||
|
private boolean condition;
|
||||||
|
|
||||||
|
private String method(final String variable) {
|
||||||
|
return "value: " + variable;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fails if not suppressed.
|
||||||
|
*
|
||||||
|
* @return value
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("movevariableinsideif")
|
||||||
|
protected String invalid() {
|
||||||
|
String variable = input.substring(1);
|
||||||
|
if (condition) {
|
||||||
|
return method(variable);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rewrite {@link #invalid()} as this to pass.
|
||||||
|
*
|
||||||
|
* @return value
|
||||||
|
*/
|
||||||
|
protected String valid() {
|
||||||
|
if (condition) {
|
||||||
|
String variable = input.substring(1);
|
||||||
|
return method(variable);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,11 +7,11 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>net.kemitix</groupId>
|
<groupId>net.kemitix</groupId>
|
||||||
<artifactId>kemitix-checkstyle-ruleset-parent</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-parent</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>kemitix-checkstyle-ruleset</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>Kemitix Checkstyle Ruleset</name>
|
<name>Kemitix Checkstyle Ruleset</name>
|
||||||
|
|
|
@ -4,61 +4,61 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="RegexpOnFilename">
|
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck">
|
||||||
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
<property name="match" value="true"/>
|
<property name="match" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="FileTabCharacter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck"/>
|
||||||
<module name="Header">
|
<module name="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NewlineAtEndOfFile">
|
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
|
||||||
<property name="lineSeparator" value="lf"/>
|
<property name="lineSeparator" value="lf"/>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
|
|
||||||
<module name="AnnotationLocation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck"/>
|
||||||
<module name="AnnotationUseStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck"/>
|
||||||
<module name="ArrayTypeStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
|
||||||
<module name="AvoidStarImport"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
|
||||||
<module name="CommentsIndentation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
|
||||||
<module name="DeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck"/>
|
||||||
<module name="EmptyForInitializerPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck"/>
|
||||||
<module name="EmptyForIteratorPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck"/>
|
||||||
<module name="EmptyLineSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck"/>
|
||||||
<module name="EmptyStatement"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"/>
|
||||||
<module name="GenericWhitespace"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck"/>
|
||||||
<module name="LeftCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
|
||||||
<module name="LineLength">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck">
|
||||||
<property name="max" value="120"/>
|
<property name="max" value="120"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="MethodParamPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
|
||||||
<module name="NoLineWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
|
||||||
<module name="NoWhitespaceAfter">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="allowLineBreaks" value="false"/>
|
<property name="allowLineBreaks" value="false"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NoWhitespaceBefore"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
|
||||||
<module name="OneStatementPerLine"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
|
||||||
<module name="OperatorWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck"/>
|
||||||
<module name="OverloadMethodsDeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck"/>
|
||||||
<module name="ParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
|
||||||
<module name="RightCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
|
||||||
<module name="SeparatorWrap">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="option" value="nl"/>
|
<property name="option" value="nl"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SingleSpaceSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
|
||||||
<module name="TrailingComment"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck"/>
|
||||||
<module name="TypecastParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck"/>
|
||||||
<module name="UnnecessaryParentheses"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck"/>
|
||||||
<module name="UnusedImports"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck"/>
|
||||||
<module name="UpperEll"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck"/>
|
||||||
<module name="WhitespaceAfter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
||||||
<module name="WhitespaceAround"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
||||||
<module name="ForbidCCommentsInMethods"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -4,93 +4,93 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="RegexpOnFilename">
|
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck">
|
||||||
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
<property name="match" value="true"/>
|
<property name="match" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="FileTabCharacter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck"/>
|
||||||
<module name="Header">
|
<module name="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NewlineAtEndOfFile">
|
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
|
||||||
<property name="lineSeparator" value="lf"/>
|
<property name="lineSeparator" value="lf"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsFilter"/>
|
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressWarningsFilter"/>
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
|
|
||||||
<module name="AbbreviationAsWordInName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameCheck"/>
|
||||||
<module name="AbstractClassName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck"/>
|
||||||
<module name="AnnotationLocation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck"/>
|
||||||
<module name="AnnotationUseStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck"/>
|
||||||
<module name="ArrayTypeStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
|
||||||
<module name="AvoidStarImport"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
|
||||||
<module name="CatchParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck"/>
|
||||||
<module name="ClassTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck"/>
|
||||||
<module name="CommentsIndentation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
|
||||||
<module name="ConstantName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
|
||||||
<module name="DeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck"/>
|
||||||
<module name="EmptyForInitializerPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck"/>
|
||||||
<module name="EmptyForIteratorPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck"/>
|
||||||
<module name="EmptyLineSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck"/>
|
||||||
<module name="EmptyStatement"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"/>
|
||||||
<module name="GenericWhitespace"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck"/>
|
||||||
<module name="InterfaceTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/>
|
||||||
<module name="LeftCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
|
||||||
<module name="LineLength">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck">
|
||||||
<property name="max" value="120"/>
|
<property name="max" value="120"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="LocalFinalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck"/>
|
||||||
<module name="LocalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck"/>
|
||||||
<module name="MagicNumber"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
|
||||||
<module name="MemberName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck"/>
|
||||||
<module name="MethodName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck"/>
|
||||||
<module name="MethodParamPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
|
||||||
<module name="MethodTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck"/>
|
||||||
<module name="ModifierOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
|
||||||
<module name="MultipleStringLiterals"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck"/>
|
||||||
<module name="MultipleVariableDeclarations"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck"/>
|
||||||
<module name="NeedBraces"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/>
|
||||||
<module name="NoLineWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
|
||||||
<module name="NoWhitespaceAfter">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="allowLineBreaks" value="false"/>
|
<property name="allowLineBreaks" value="false"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NoWhitespaceBefore"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
|
||||||
<module name="OneStatementPerLine"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
|
||||||
<module name="OperatorWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck"/>
|
||||||
<module name="OverloadMethodsDeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck"/>
|
||||||
<module name="PackageName">
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck">
|
||||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck"/>
|
||||||
<module name="ParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
|
||||||
<module name="RightCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
|
||||||
<module name="SeparatorWrap">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="option" value="nl"/>
|
<property name="option" value="nl"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SingleSpaceSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
|
||||||
<module name="StaticVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/>
|
||||||
<module name="SuppressWarnings">
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck">
|
||||||
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsHolder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder"/>
|
||||||
<module name="TrailingComment"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck"/>
|
||||||
<module name="TypecastParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck"/>
|
||||||
<module name="TypeName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck"/>
|
||||||
<module name="UnnecessaryParentheses"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck"/>
|
||||||
<module name="UnusedImports"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck"/>
|
||||||
<module name="UpperEll"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck"/>
|
||||||
<module name="WhitespaceAfter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
||||||
<module name="WhitespaceAround"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
||||||
<module name="EnumValueName"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
|
||||||
<module name="ForbidCCommentsInMethods"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
|
||||||
<module name="NameConventionForJunit4TestClasses"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
|
||||||
<module name="NumericLiteralNeedsUnderscore"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
|
||||||
<module name="SimpleAccessorNameNotation"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/>
|
||||||
<module name="UniformEnumConstantName"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.UniformEnumConstantNameCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -4,119 +4,119 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="RegexpOnFilename">
|
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck">
|
||||||
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
<property name="match" value="true"/>
|
<property name="match" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="FileTabCharacter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck"/>
|
||||||
<module name="Header">
|
<module name="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="JavadocPackage"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck"/>
|
||||||
<module name="NewlineAtEndOfFile">
|
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
|
||||||
<property name="lineSeparator" value="lf"/>
|
<property name="lineSeparator" value="lf"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsFilter"/>
|
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressWarningsFilter"/>
|
||||||
<module name="Translation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TranslationCheck"/>
|
||||||
<module name="UniqueProperties"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck"/>
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
|
|
||||||
<module name="AbbreviationAsWordInName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameCheck"/>
|
||||||
<module name="AbstractClassName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck"/>
|
||||||
<module name="AnnotationLocation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck"/>
|
||||||
<module name="AnnotationUseStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck"/>
|
||||||
<module name="ArrayTypeStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
|
||||||
<module name="AtclauseOrder">
|
<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"/>
|
<property name="tagOrder" value="@param, @author, @version, @serial, @return, @throws, @exception, @serialData, @serialField, @see, @since, @deprecated"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="AvoidStarImport"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
|
||||||
<module name="CatchParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck"/>
|
||||||
<module name="ClassTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck"/>
|
||||||
<module name="CommentsIndentation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
|
||||||
<module name="ConstantName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
|
||||||
<module name="DeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck"/>
|
||||||
<module name="EmptyForInitializerPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck"/>
|
||||||
<module name="EmptyForIteratorPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck"/>
|
||||||
<module name="EmptyLineSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck"/>
|
||||||
<module name="EmptyStatement"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"/>
|
||||||
<module name="FallThrough"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck"/>
|
||||||
<module name="GenericWhitespace"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck"/>
|
||||||
<module name="InterfaceTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/>
|
||||||
<module name="JavadocMethod">
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
|
||||||
<property name="allowMissingPropertyJavadoc" value="true"/>
|
<property name="allowMissingPropertyJavadoc" value="true"/>
|
||||||
<property name="validateThrows" value="true"/>
|
<property name="validateThrows" value="true"/>
|
||||||
<property name="scope" value="package"/>
|
<property name="scope" value="package"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="JavadocParagraph"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
|
||||||
<module name="JavadocStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
|
||||||
<module name="JavadocType">
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
|
||||||
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
|
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="LeftCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
|
||||||
<module name="LineLength">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck">
|
||||||
<property name="max" value="120"/>
|
<property name="max" value="120"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="LocalFinalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck"/>
|
||||||
<module name="LocalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck"/>
|
||||||
<module name="MagicNumber"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
|
||||||
<module name="MemberName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck"/>
|
||||||
<module name="MethodName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck"/>
|
||||||
<module name="MethodParamPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
|
||||||
<module name="MethodTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck"/>
|
||||||
<module name="MissingDeprecated"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"/>
|
||||||
<module name="ModifierOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
|
||||||
<module name="MultipleStringLiterals"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck"/>
|
||||||
<module name="MultipleVariableDeclarations"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck"/>
|
||||||
<module name="NeedBraces"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/>
|
||||||
<module name="NoLineWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
|
||||||
<module name="NonEmptyAtclauseDescription"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
|
||||||
<module name="NoWhitespaceAfter">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="allowLineBreaks" value="false"/>
|
<property name="allowLineBreaks" value="false"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NoWhitespaceBefore"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
|
||||||
<module name="OneStatementPerLine"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
|
||||||
<module name="OperatorWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck"/>
|
||||||
<module name="OverloadMethodsDeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck"/>
|
||||||
<module name="PackageDeclaration"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck"/>
|
||||||
<module name="PackageName">
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck">
|
||||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck"/>
|
||||||
<module name="ParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
|
||||||
<module name="RightCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
|
||||||
<module name="SeparatorWrap">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="option" value="nl"/>
|
<property name="option" value="nl"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SingleSpaceSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
|
||||||
<module name="StaticVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/>
|
||||||
<module name="SuppressWarnings">
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck">
|
||||||
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsHolder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder"/>
|
||||||
<module name="TodoComment">
|
<module name="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck">
|
||||||
<property name="format" value="^(\s*\*).*((TODO)|(FIXME))"/>
|
<property name="format" value="^(\s*\*).*((TODO)|(FIXME))"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="TrailingComment"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck"/>
|
||||||
<module name="TypecastParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck"/>
|
||||||
<module name="TypeName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck"/>
|
||||||
<module name="UncommentedMain">
|
<module name="com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck">
|
||||||
<property name="excludedClasses" value="(Main|Application)$"/>
|
<property name="excludedClasses" value="(Main|Application)$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="UnnecessaryParentheses"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck"/>
|
||||||
<module name="UnusedImports"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck"/>
|
||||||
<module name="UpperEll"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck"/>
|
||||||
<module name="WhitespaceAfter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
||||||
<module name="WhitespaceAround"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
||||||
<module name="EnumValueName"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
|
||||||
<module name="ForbidCCommentsInMethods"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
|
||||||
<module name="NameConventionForJunit4TestClasses"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
|
||||||
<module name="NumericLiteralNeedsUnderscore"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
|
||||||
<module name="SimpleAccessorNameNotation"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/>
|
||||||
<module name="UniformEnumConstantName"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.UniformEnumConstantNameCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -4,177 +4,180 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="RegexpOnFilename">
|
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck">
|
||||||
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
<property name="match" value="true"/>
|
<property name="match" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="FileTabCharacter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck"/>
|
||||||
<module name="Header">
|
<module name="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="JavadocPackage"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck"/>
|
||||||
<module name="NewlineAtEndOfFile">
|
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
|
||||||
<property name="lineSeparator" value="lf"/>
|
<property name="lineSeparator" value="lf"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsFilter"/>
|
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressWarningsFilter"/>
|
||||||
<module name="Translation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TranslationCheck"/>
|
||||||
<module name="UniqueProperties"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck"/>
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
|
|
||||||
<module name="AbbreviationAsWordInName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameCheck"/>
|
||||||
<module name="AbstractClassName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck"/>
|
||||||
<module name="AnnotationLocation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck"/>
|
||||||
<module name="AnnotationUseStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck"/>
|
||||||
<module name="ArrayTypeStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
|
||||||
<module name="AtclauseOrder">
|
<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"/>
|
<property name="tagOrder" value="@param, @author, @version, @serial, @return, @throws, @exception, @serialData, @serialField, @see, @since, @deprecated"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="AvoidEscapedUnicodeCharacters">
|
<module name="com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck">
|
||||||
<property name="allowEscapesForControlCharacters" value="true"/>
|
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="AvoidStarImport"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
|
||||||
<module name="CatchParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck"/>
|
||||||
<module name="ClassTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck"/>
|
||||||
<module name="CommentsIndentation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
|
||||||
<module name="ConstantName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
|
||||||
<module name="DeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck"/>
|
||||||
<module name="DefaultComesLast"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck"/>
|
||||||
<module name="EmptyBlock"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck"/>
|
||||||
<module name="EmptyCatchBlock">
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck">
|
||||||
<property name="commentFormat" value="expected|ignore"/>
|
<property name="commentFormat" value="expected|ignore"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="EmptyForInitializerPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck"/>
|
||||||
<module name="EmptyForIteratorPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck"/>
|
||||||
<module name="EmptyLineSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck"/>
|
||||||
<module name="EmptyStatement"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"/>
|
||||||
<module name="EqualsAvoidNull"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck"/>
|
||||||
<module name="ExplicitInitialization"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck">
|
||||||
<module name="FallThrough"/>
|
<property name="onlyObjectReferences" value="true"/>
|
||||||
<module name="FinalParameters"/>
|
</module>
|
||||||
<module name="GenericWhitespace"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck"/>
|
||||||
<module name="HiddenField">
|
<module name="com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck">
|
||||||
<property name="ignoreConstructorParameter" value="true"/>
|
<property name="ignoreConstructorParameter" value="true"/>
|
||||||
<property name="ignoreSetter" value="true"/>
|
<property name="ignoreSetter" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="HideUtilityClassConstructor"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck"/>
|
||||||
<module name="IllegalCatch"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck"/>
|
||||||
<module name="IllegalImport"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"/>
|
||||||
<module name="IllegalThrows"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck"/>
|
||||||
<module name="IllegalToken"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck"/>
|
||||||
<module name="IllegalType">
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck">
|
||||||
<property name="illegalClassNames" value="java.util.ArrayDeque, java.util.ArrayList, java.util.EnumMap, java.util.EnumSet, java.util.HashMap, java.util.HashSet, java.util.IdentityHashMap, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.PriorityQueue, java.util.TreeMap, java.util.TreeSet"/>
|
<property name="illegalClassNames" value="java.util.ArrayDeque, java.util.ArrayList, java.util.EnumMap, java.util.EnumSet, java.util.HashMap, java.util.HashSet, java.util.IdentityHashMap, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.PriorityQueue, java.util.TreeMap, java.util.TreeSet"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="InnerAssignment"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck"/>
|
||||||
<module name="InnerTypeLast"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck"/>
|
||||||
<module name="InterfaceTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/>
|
||||||
<module name="JavadocMethod">
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
|
||||||
<property name="allowMissingPropertyJavadoc" value="true"/>
|
<property name="allowMissingPropertyJavadoc" value="true"/>
|
||||||
<property name="validateThrows" value="true"/>
|
<property name="validateThrows" value="true"/>
|
||||||
<property name="scope" value="package"/>
|
<property name="scope" value="package"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="JavadocParagraph"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
|
||||||
<module name="JavadocStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
|
||||||
<module name="JavadocType">
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
|
||||||
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
|
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="LeftCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
|
||||||
<module name="LineLength">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck">
|
||||||
<property name="max" value="120"/>
|
<property name="max" value="120"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="LocalFinalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck"/>
|
||||||
<module name="LocalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck"/>
|
||||||
<module name="MagicNumber"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
|
||||||
<module name="MemberName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck"/>
|
||||||
<module name="MethodName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck"/>
|
||||||
<module name="MethodParamPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
|
||||||
<module name="MethodTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck"/>
|
||||||
<module name="MissingDeprecated"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"/>
|
||||||
<module name="MissingSwitchDefault"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck"/>
|
||||||
<module name="ModifiedControlVariable">
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariableCheck">
|
||||||
<property name="skipEnhancedForLoopVariable" value="true"/>
|
<property name="skipEnhancedForLoopVariable" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ModifierOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
|
||||||
<module name="MultipleStringLiterals"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck"/>
|
||||||
<module name="MultipleVariableDeclarations"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck"/>
|
||||||
<module name="MutableException"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck"/>
|
||||||
<module name="NeedBraces"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/>
|
||||||
<module name="NoClone"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck"/>
|
||||||
<module name="NoFinalizer"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck"/>
|
||||||
<module name="NoLineWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
|
||||||
<module name="NonEmptyAtclauseDescription"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
|
||||||
<module name="NoWhitespaceAfter">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="allowLineBreaks" value="false"/>
|
<property name="allowLineBreaks" value="false"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NoWhitespaceBefore"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
|
||||||
<module name="OneStatementPerLine"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
|
||||||
<module name="OneTopLevelClass"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck"/>
|
||||||
<module name="OperatorWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck"/>
|
||||||
<module name="OuterTypeFilename"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck"/>
|
||||||
<module name="OverloadMethodsDeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck"/>
|
||||||
<module name="PackageAnnotation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck"/>
|
||||||
<module name="PackageDeclaration"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck"/>
|
||||||
<module name="PackageName">
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck">
|
||||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck"/>
|
||||||
<module name="ParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
|
||||||
<module name="RedundantModifier"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck"/>
|
||||||
<module name="RequireThis">
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck">
|
||||||
<property name="checkMethods" value="false"/>
|
<property name="checkMethods" value="false"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="RightCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
|
||||||
<module name="SeparatorWrap">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="option" value="nl"/>
|
<property name="option" value="nl"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SingleSpaceSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
|
||||||
<module name="StaticVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/>
|
||||||
<module name="StringLiteralEquality"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck"/>
|
||||||
<module name="SuppressWarnings">
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck">
|
||||||
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsHolder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder"/>
|
||||||
<module name="TodoComment">
|
<module name="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck">
|
||||||
<property name="format" value="^(\s*\*).*((TODO)|(FIXME))"/>
|
<property name="format" value="^(\s*\*).*((TODO)|(FIXME))"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="TrailingComment"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck"/>
|
||||||
<module name="TypecastParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck"/>
|
||||||
<module name="TypeName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck"/>
|
||||||
<module name="UncommentedMain">
|
<module name="com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck">
|
||||||
<property name="excludedClasses" value="(Main|Application)$"/>
|
<property name="excludedClasses" value="(Main|Application)$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="UnnecessaryParentheses"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck"/>
|
||||||
<module name="UnusedImports"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck"/>
|
||||||
<module name="UpperEll"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck"/>
|
||||||
<module name="VariableDeclarationUsageDistance"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck"/>
|
||||||
<module name="VisibilityModifier"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
|
||||||
<module name="WhitespaceAfter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
||||||
<module name="WhitespaceAround"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
||||||
<module name="AvoidConstantAsFirstOperandInCondition"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidConstantAsFirstOperandInConditionCheck"/>
|
||||||
<module name="AvoidHidingCauseException"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidHidingCauseExceptionCheck"/>
|
||||||
<module name="AvoidNotShortCircuitOperatorsForBoolean"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidNotShortCircuitOperatorsForBooleanCheck"/>
|
||||||
<module name="DiamondOperatorForVariableDefinition"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.DiamondOperatorForVariableDefinitionCheck"/>
|
||||||
<module name="EitherLogOrThrow"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.EitherLogOrThrowCheck"/>
|
||||||
<module name="EnumValueName"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
|
||||||
<module name="ForbidCCommentsInMethods"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
|
||||||
<module name="LogicConditionNeedOptimization"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.LogicConditionNeedOptimizationCheck"/>
|
||||||
<module name="NameConventionForJunit4TestClasses"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
|
||||||
<module name="NoMainMethodInAbstractClass"/>
|
<module name="com.github.sevntu.checkstyle.checks.design.NoMainMethodInAbstractClassCheck"/>
|
||||||
<module name="NumericLiteralNeedsUnderscore"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
|
||||||
<module name="OverridableMethodInConstructor"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.OverridableMethodInConstructorCheck"/>
|
||||||
<module name="PublicReferenceToPrivateType"/>
|
<module name="com.github.sevntu.checkstyle.checks.design.PublicReferenceToPrivateTypeCheck"/>
|
||||||
<module name="RedundantReturn"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.RedundantReturnCheck"/>
|
||||||
<module name="ReturnBooleanFromTernary"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ReturnBooleanFromTernaryCheck"/>
|
||||||
<module name="ReturnNullInsteadOfBoolean"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck"/>
|
||||||
<module name="SimpleAccessorNameNotation"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/>
|
||||||
<module name="SingleBreakOrContinue"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.SingleBreakOrContinueCheck"/>
|
||||||
<module name="TernaryPerExpressionCount"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.TernaryPerExpressionCountCheck"/>
|
||||||
<module name="UniformEnumConstantName"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.UniformEnumConstantNameCheck"/>
|
||||||
<module name="UselessSingleCatch"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.UselessSingleCatchCheck"/>
|
||||||
<module name="UselessSuperCtorCall"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.UselessSuperCtorCallCheck"/>
|
||||||
|
<module name="com.github.sevntu.checkstyle.checks.coding.MoveVariableInsideIfCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -4,229 +4,233 @@
|
||||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||||
<module name="Checker">
|
<module name="Checker">
|
||||||
|
|
||||||
<module name="RegexpOnFilename">
|
<module name="com.puppycrawl.tools.checkstyle.checks.regexp.RegexpOnFilenameCheck">
|
||||||
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
<property name="fileNamePattern" value="(.sync-conflict-| conflicted copy )"/>
|
||||||
<property name="match" value="true"/>
|
<property name="match" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="FileLength"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.FileLengthCheck"/>
|
||||||
<module name="FileTabCharacter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck"/>
|
||||||
<module name="Header">
|
<module name="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck">
|
||||||
<property name="fileExtensions" value="java"/>
|
<property name="fileExtensions" value="java"/>
|
||||||
<property name="headerFile" value="LICENSE.txt"/>
|
<property name="headerFile" value="LICENSE.txt"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="JavadocPackage"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocPackageCheck"/>
|
||||||
<module name="NewlineAtEndOfFile">
|
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck">
|
||||||
<property name="lineSeparator" value="lf"/>
|
<property name="lineSeparator" value="lf"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsFilter"/>
|
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressWarningsFilter"/>
|
||||||
<module name="Translation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TranslationCheck"/>
|
||||||
<module name="UniqueProperties"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UniquePropertiesCheck"/>
|
||||||
|
|
||||||
<module name="TreeWalker">
|
<module name="TreeWalker">
|
||||||
|
|
||||||
<module name="AbbreviationAsWordInName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbbreviationAsWordInNameCheck"/>
|
||||||
<module name="AbstractClassName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.AbstractClassNameCheck"/>
|
||||||
<module name="AnnotationLocation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationLocationCheck"/>
|
||||||
<module name="AnnotationUseStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck"/>
|
||||||
<module name="AnonInnerLength"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck"/>
|
||||||
<module name="ArrayTypeStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.ArrayTypeStyleCheck"/>
|
||||||
<module name="AtclauseOrder">
|
<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"/>
|
<property name="tagOrder" value="@param, @author, @version, @serial, @return, @throws, @exception, @serialData, @serialField, @see, @since, @deprecated"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="AvoidEscapedUnicodeCharacters">
|
<module name="com.puppycrawl.tools.checkstyle.checks.AvoidEscapedUnicodeCharactersCheck">
|
||||||
<property name="allowEscapesForControlCharacters" value="true"/>
|
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="AvoidInlineConditionals"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.AvoidInlineConditionalsCheck"/>
|
||||||
<module name="AvoidNestedBlocks"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.AvoidNestedBlocksCheck"/>
|
||||||
<module name="AvoidStarImport"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck"/>
|
||||||
<module name="AvoidStaticImport">
|
<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.*"/>
|
<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>
|
||||||
<module name="BooleanExpressionComplexity">
|
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck">
|
||||||
<property name="max" value="2"/>
|
<property name="max" value="2"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="CatchParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.CatchParameterNameCheck"/>
|
||||||
<module name="ClassDataAbstractionCoupling"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.ClassDataAbstractionCouplingCheck"/>
|
||||||
<module name="ClassFanOutComplexity"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.ClassFanOutComplexityCheck"/>
|
||||||
<module name="ClassTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ClassTypeParameterNameCheck"/>
|
||||||
<module name="CommentsIndentation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.indentation.CommentsIndentationCheck"/>
|
||||||
<module name="ConstantName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck"/>
|
||||||
<module name="CovariantEquals"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.CovariantEqualsCheck"/>
|
||||||
<module name="CyclomaticComplexity">
|
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck">
|
||||||
<property name="max" value="5"/>
|
<property name="max" value="5"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="DeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck"/>
|
||||||
<module name="DefaultComesLast"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck"/>
|
||||||
<module name="DesignForExtension"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck"/>
|
||||||
<module name="EmptyBlock"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyBlockCheck"/>
|
||||||
<module name="EmptyCatchBlock">
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.EmptyCatchBlockCheck">
|
||||||
<property name="commentFormat" value="expected|ignore"/>
|
<property name="commentFormat" value="expected|ignore"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="EmptyForInitializerPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForInitializerPadCheck"/>
|
||||||
<module name="EmptyForIteratorPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyForIteratorPadCheck"/>
|
||||||
<module name="EmptyLineSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck"/>
|
||||||
<module name="EmptyStatement"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck"/>
|
||||||
<module name="EqualsAvoidNull"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck"/>
|
||||||
<module name="EqualsHashCode"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck"/>
|
||||||
<module name="ExecutableStatementCount"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.ExecutableStatementCountCheck"/>
|
||||||
<module name="ExplicitInitialization"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ExplicitInitializationCheck">
|
||||||
<module name="FallThrough"/>
|
<property name="onlyObjectReferences" value="true"/>
|
||||||
<module name="FinalClass"/>
|
</module>
|
||||||
<module name="FinalParameters"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.FallThroughCheck"/>
|
||||||
<module name="GenericWhitespace"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck"/>
|
||||||
<module name="HiddenField">
|
<module name="com.puppycrawl.tools.checkstyle.checks.FinalParametersCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.GenericWhitespaceCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck">
|
||||||
<property name="ignoreConstructorParameter" value="true"/>
|
<property name="ignoreConstructorParameter" value="true"/>
|
||||||
<property name="ignoreSetter" value="true"/>
|
<property name="ignoreSetter" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="HideUtilityClassConstructor"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck"/>
|
||||||
<module name="IllegalCatch"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck"/>
|
||||||
<module name="IllegalImport"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.IllegalImportCheck"/>
|
||||||
<module name="IllegalThrows"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck"/>
|
||||||
<module name="IllegalToken"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalTokenCheck"/>
|
||||||
<module name="IllegalType">
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.IllegalTypeCheck">
|
||||||
<property name="illegalClassNames" value="java.util.ArrayDeque, java.util.ArrayList, java.util.EnumMap, java.util.EnumSet, java.util.HashMap, java.util.HashSet, java.util.IdentityHashMap, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.PriorityQueue, java.util.TreeMap, java.util.TreeSet"/>
|
<property name="illegalClassNames" value="java.util.ArrayDeque, java.util.ArrayList, java.util.EnumMap, java.util.EnumSet, java.util.HashMap, java.util.HashSet, java.util.IdentityHashMap, java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.PriorityQueue, java.util.TreeMap, java.util.TreeSet"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="InnerAssignment"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck"/>
|
||||||
<module name="InnerTypeLast"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.InnerTypeLastCheck"/>
|
||||||
<module name="InterfaceIsType"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.InterfaceIsTypeCheck"/>
|
||||||
<module name="InterfaceTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.InterfaceTypeParameterNameCheck"/>
|
||||||
<module name="JavadocMethod">
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
|
||||||
<property name="allowMissingPropertyJavadoc" value="true"/>
|
<property name="allowMissingPropertyJavadoc" value="true"/>
|
||||||
<property name="validateThrows" value="true"/>
|
<property name="validateThrows" value="true"/>
|
||||||
<property name="scope" value="package"/>
|
<property name="scope" value="package"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="JavadocParagraph"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocParagraphCheck"/>
|
||||||
<module name="JavadocStyle"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocStyleCheck"/>
|
||||||
<module name="JavadocType">
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
|
||||||
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
|
<property name="authorFormat" value="^.+ (\S+@[\S.]+)$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="JavaNCSS">
|
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.JavaNCSSCheck">
|
||||||
<property name="classMaximum" value="1200"/>
|
<property name="classMaximum" value="1200"/>
|
||||||
<property name="fileMaximum" value="1600"/>
|
<property name="fileMaximum" value="1600"/>
|
||||||
<property name="methodMaximum" value="40"/>
|
<property name="methodMaximum" value="40"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="LeftCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.LeftCurlyCheck"/>
|
||||||
<module name="LineLength">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LineLengthCheck">
|
||||||
<property name="max" value="120"/>
|
<property name="max" value="120"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="LocalFinalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck"/>
|
||||||
<module name="LocalVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck"/>
|
||||||
<module name="MagicNumber"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck"/>
|
||||||
<module name="MemberName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck"/>
|
||||||
<module name="MethodCount">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.MethodCountCheck">
|
||||||
<property name="maxTotal" value="30"/>
|
<property name="maxTotal" value="30"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="MethodLength">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.MethodLengthCheck">
|
||||||
<property name="max" value="40"/>
|
<property name="max" value="40"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="MethodName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck"/>
|
||||||
<module name="MethodParamPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.MethodParamPadCheck"/>
|
||||||
<module name="MethodTypeParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodTypeParameterNameCheck"/>
|
||||||
<module name="MissingDeprecated"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.MissingDeprecatedCheck"/>
|
||||||
<module name="MissingSwitchDefault"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MissingSwitchDefaultCheck"/>
|
||||||
<module name="ModifiedControlVariable">
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ModifiedControlVariableCheck">
|
||||||
<property name="skipEnhancedForLoopVariable" value="true"/>
|
<property name="skipEnhancedForLoopVariable" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ModifierOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
|
||||||
<module name="MultipleStringLiterals"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleStringLiteralsCheck"/>
|
||||||
<module name="MultipleVariableDeclarations"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.MultipleVariableDeclarationsCheck"/>
|
||||||
<module name="MutableException"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.MutableExceptionCheck"/>
|
||||||
<module name="NeedBraces"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck"/>
|
||||||
<module name="NestedForDepth"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedForDepthCheck"/>
|
||||||
<module name="NestedIfDepth"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedIfDepthCheck"/>
|
||||||
<module name="NestedTryDepth">
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NestedTryDepthCheck">
|
||||||
<property name="max" value="0"/>
|
<property name="max" value="0"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NoClone"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NoCloneCheck"/>
|
||||||
<module name="NoFinalizer"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.NoFinalizerCheck"/>
|
||||||
<module name="NoLineWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoLineWrapCheck"/>
|
||||||
<module name="NonEmptyAtclauseDescription"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck"/>
|
||||||
<module name="NoWhitespaceAfter">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceAfterCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="allowLineBreaks" value="false"/>
|
<property name="allowLineBreaks" value="false"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="NoWhitespaceBefore"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCheck"/>
|
||||||
<module name="NPathComplexity">
|
<module name="com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck">
|
||||||
<property name="max" value="5"/>
|
<property name="max" value="5"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="OneStatementPerLine"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck"/>
|
||||||
<module name="OneTopLevelClass"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.OneTopLevelClassCheck"/>
|
||||||
<module name="OperatorWrap"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.OperatorWrapCheck"/>
|
||||||
<module name="OuterTypeFilename"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck"/>
|
||||||
<module name="OverloadMethodsDeclarationOrder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.OverloadMethodsDeclarationOrderCheck"/>
|
||||||
<module name="PackageAnnotation"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.PackageAnnotationCheck"/>
|
||||||
<module name="PackageDeclaration"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck"/>
|
||||||
<module name="PackageName">
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck">
|
||||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]+)*$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ParameterName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck"/>
|
||||||
<module name="ParameterNumber">
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.ParameterNumberCheck">
|
||||||
<property name="ignoreOverriddenMethods" value="true"/>
|
<property name="ignoreOverriddenMethods" value="true"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.ParenPadCheck"/>
|
||||||
<module name="RedundantModifier"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck"/>
|
||||||
<module name="RequireThis">
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.RequireThisCheck">
|
||||||
<property name="checkMethods" value="false"/>
|
<property name="checkMethods" value="false"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="ReturnCount"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.ReturnCountCheck"/>
|
||||||
<module name="RightCurly"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.blocks.RightCurlyCheck"/>
|
||||||
<module name="SeparatorWrap">
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SeparatorWrapCheck">
|
||||||
<property name="tokens" value="DOT"/>
|
<property name="tokens" value="DOT"/>
|
||||||
<property name="option" value="nl"/>
|
<property name="option" value="nl"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SimplifyBooleanExpression"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck"/>
|
||||||
<module name="SimplifyBooleanReturn"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck"/>
|
||||||
<module name="SingleSpaceSeparator"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.SingleSpaceSeparatorCheck"/>
|
||||||
<module name="StaticVariableName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck"/>
|
||||||
<module name="StringLiteralEquality"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck"/>
|
||||||
<module name="SuppressWarnings">
|
<module name="com.puppycrawl.tools.checkstyle.checks.annotation.SuppressWarningsCheck">
|
||||||
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
<property name="format" value="^constantname|covariantequals|equalshashcode|noclone|onetoplevelclass|outertypefilename|packagedeclaration|typename|visibilitymodifier$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="SuppressWarningsHolder"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.SuppressWarningsHolder"/>
|
||||||
<module name="ThrowsCount"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.ThrowsCountCheck"/>
|
||||||
<module name="TodoComment">
|
<module name="com.puppycrawl.tools.checkstyle.checks.TodoCommentCheck">
|
||||||
<property name="format" value="^(\s*\*).*((TODO)|(FIXME))"/>
|
<property name="format" value="^(\s*\*).*((TODO)|(FIXME))"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="TrailingComment"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.TrailingCommentCheck"/>
|
||||||
<module name="TypecastParenPad"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.TypecastParenPadCheck"/>
|
||||||
<module name="TypeName"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck"/>
|
||||||
<module name="UncommentedMain">
|
<module name="com.puppycrawl.tools.checkstyle.checks.UncommentedMainCheck">
|
||||||
<property name="excludedClasses" value="(Main|Application)$"/>
|
<property name="excludedClasses" value="(Main|Application)$"/>
|
||||||
</module>
|
</module>
|
||||||
<module name="UnnecessaryParentheses"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessaryParenthesesCheck"/>
|
||||||
<module name="UnusedImports"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck"/>
|
||||||
<module name="UpperEll"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.UpperEllCheck"/>
|
||||||
<module name="VariableDeclarationUsageDistance"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.VariableDeclarationUsageDistanceCheck"/>
|
||||||
<module name="VisibilityModifier"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck"/>
|
||||||
<module name="WhitespaceAfter"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
||||||
<module name="WhitespaceAround"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
||||||
<module name="AvoidConstantAsFirstOperandInCondition"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidConstantAsFirstOperandInConditionCheck"/>
|
||||||
<module name="AvoidHidingCauseException"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidHidingCauseExceptionCheck"/>
|
||||||
<module name="AvoidNotShortCircuitOperatorsForBoolean"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.AvoidNotShortCircuitOperatorsForBooleanCheck"/>
|
||||||
<module name="ConfusingCondition"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ConfusingConditionCheck"/>
|
||||||
<module name="ConstructorWithoutParams"/>
|
<module name="com.github.sevntu.checkstyle.checks.design.ConstructorWithoutParamsCheck"/>
|
||||||
<module name="DiamondOperatorForVariableDefinition"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.DiamondOperatorForVariableDefinitionCheck"/>
|
||||||
<module name="EitherLogOrThrow"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.EitherLogOrThrowCheck"/>
|
||||||
<module name="EnumValueName"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.EnumValueNameCheck"/>
|
||||||
<module name="ForbidCCommentsInMethods"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidCCommentsInMethodsCheck"/>
|
||||||
<module name="ForbidReturnInFinallyBlock"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ForbidReturnInFinallyBlockCheck"/>
|
||||||
<module name="LogicConditionNeedOptimization"/>
|
<module name="com.github.sevntu.checkstyle.checks.design.ForbidWildcardAsReturnTypeCheck"/>
|
||||||
<module name="MapIterationInForEachLoop"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.LogicConditionNeedOptimizationCheck"/>
|
||||||
<module name="NameConventionForJunit4TestClasses"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.MapIterationInForEachLoopCheck"/>
|
||||||
<module name="NestedSwitch"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NameConventionForJunit4TestClassesCheck"/>
|
||||||
<module name="NoMainMethodInAbstractClass"/>
|
<module name="com.github.sevntu.checkstyle.checks.design.NestedSwitchCheck"/>
|
||||||
<module name="NumericLiteralNeedsUnderscore"/>
|
<module name="com.github.sevntu.checkstyle.checks.design.NoMainMethodInAbstractClassCheck"/>
|
||||||
<module name="OverridableMethodInConstructor"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck"/>
|
||||||
<module name="PublicReferenceToPrivateType"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.OverridableMethodInConstructorCheck"/>
|
||||||
<module name="RedundantReturn"/>
|
<module name="com.github.sevntu.checkstyle.checks.design.PublicReferenceToPrivateTypeCheck"/>
|
||||||
<module name="ReturnBooleanFromTernary"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.RedundantReturnCheck"/>
|
||||||
<module name="ReturnNullInsteadOfBoolean"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ReturnBooleanFromTernaryCheck"/>
|
||||||
<module name="SimpleAccessorNameNotation"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck"/>
|
||||||
<module name="SingleBreakOrContinue"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.SimpleAccessorNameNotationCheck"/>
|
||||||
<module name="TernaryPerExpressionCount"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.SingleBreakOrContinueCheck"/>
|
||||||
<module name="UniformEnumConstantName"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.TernaryPerExpressionCountCheck"/>
|
||||||
<module name="UselessSingleCatch"/>
|
<module name="com.github.sevntu.checkstyle.checks.naming.UniformEnumConstantNameCheck"/>
|
||||||
<module name="UselessSuperCtorCall"/>
|
<module name="com.github.sevntu.checkstyle.checks.coding.UselessSingleCatchCheck"/>
|
||||||
|
<module name="com.github.sevntu.checkstyle.checks.coding.UselessSuperCtorCallCheck"/>
|
||||||
|
<module name="com.github.sevntu.checkstyle.checks.coding.MoveVariableInsideIfCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,14 @@
|
||||||
<artifactId>kemitix-checkstyle-ruleset-sample-parent</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-sample-parent</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<version>3.0.1</version>
|
<version>3.1.0</version>
|
||||||
|
|
||||||
<name>Kemitix Checkstyle Ruleset Sample Parent</name>
|
<name>Kemitix Checkstyle Ruleset Sample Parent</name>
|
||||||
<description>Sample parent for modules that use kemitix-checkstyle-ruleset-maven-plugin</description>
|
<description>Sample parent for modules that use kemitix-checkstyle-ruleset-maven-plugin</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<kemitix-checkstyle-ruleset-level>2-naming</kemitix-checkstyle-ruleset-level>
|
<kemitix-checkstyle-ruleset.version>${project.version}</kemitix-checkstyle-ruleset.version>
|
||||||
|
<kemitix-checkstyle-ruleset.level>5-complexity</kemitix-checkstyle-ruleset.level>
|
||||||
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
@ -50,9 +51,9 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>net.kemitix</groupId>
|
<groupId>net.kemitix</groupId>
|
||||||
<artifactId>kemitix-checkstyle-ruleset-maven-plugin</artifactId>
|
<artifactId>kemitix-checkstyle-ruleset-maven-plugin</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${kemitix-checkstyle-ruleset.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<level>${kemitix-checkstyle-ruleset-level}</level>
|
<level>${kemitix-checkstyle-ruleset.level}</level>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
|
8
shippable.yml
Normal file
8
shippable.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
language: java
|
||||||
|
jdk:
|
||||||
|
- oraclejdk8
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "$HOME/.m2"
|
||||||
|
install: true
|
||||||
|
script: "./mvnw clean install"
|
|
@ -1,10 +1,18 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then
|
if [ "$TRAVIS_BRANCH" = 'master' ]; then
|
||||||
|
echo "Preparing to deploy to nexus..."
|
||||||
openssl aes-256-cbc -K $encrypted_efec3258f55d_key -iv $encrypted_efec3258f55d_iv \
|
openssl aes-256-cbc -K $encrypted_efec3258f55d_key -iv $encrypted_efec3258f55d_iv \
|
||||||
-in travis-ci/codesigning.asc.enc -out travis-ci/codesigning.asc -d
|
-in travis-ci/codesigning.asc.enc -out travis-ci/codesigning.asc -d
|
||||||
|
echo "Signing key decrypted"
|
||||||
gpg --batch --fast-import travis-ci/codesigning.asc
|
gpg --batch --fast-import travis-ci/codesigning.asc
|
||||||
|
echo "Signing key imported"
|
||||||
./mvnw --projects plugin,ruleset --settings travis-ci/travis-settings.xml \
|
./mvnw --projects plugin,ruleset --settings travis-ci/travis-settings.xml \
|
||||||
-Dskip-Tests=true -P release -B deploy
|
-Dskip-Tests=true -P release -B deploy
|
||||||
|
echo "Deploy complete"
|
||||||
|
else
|
||||||
|
echo "Not deploying"
|
||||||
|
echo " TRAVIS_BRANCH: $TRAVIS_BRANCH"
|
||||||
|
echo " TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
6
wercker.yml
Normal file
6
wercker.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
box: maven:3.5.0-jdk-8
|
||||||
|
|
||||||
|
build:
|
||||||
|
steps:
|
||||||
|
- xenoterracide/maven:
|
||||||
|
goals: clean install
|
Loading…
Reference in a new issue