Compare commits
10 commits
1deee25d96
...
69aadf366c
Author | SHA1 | Date | |
---|---|---|---|
|
69aadf366c | ||
|
2c40e199cb | ||
|
418bfff775 | ||
|
3507df4e03 | ||
|
edf2688d1d | ||
|
1bc0757c62 | ||
50af2c98b1 | |||
b718196f79 | |||
767937448f | |||
82868e9632 |
16 changed files with 336 additions and 13 deletions
2
.github/workflows/build-maven.yml
vendored
2
.github/workflows/build-maven.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v3.1.0
|
||||||
- name: setup-jdk-${{ matrix.java }}
|
- name: setup-jdk-${{ matrix.java }}
|
||||||
uses: actions/setup-java@v2.3.0
|
uses: actions/setup-java@v3.5.1
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
|
|
2
.github/workflows/deploy-sonatype.yml
vendored
2
.github/workflows/deploy-sonatype.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.1.0
|
- uses: actions/checkout@v3.1.0
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v2.3.0
|
uses: actions/setup-java@v3.5.1
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
|
2
.github/workflows/draft-release.yml
vendored
2
.github/workflows/draft-release.yml
vendored
|
@ -9,6 +9,6 @@ jobs:
|
||||||
update_draft_release:
|
update_draft_release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: release-drafter/release-drafter@v5.16.1
|
- uses: release-drafter/release-drafter@v5.21.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
149
README.md
149
README.md
|
@ -91,11 +91,13 @@ Rule|Level|Source|Enabled|Suppressible
|
||||||
[AvoidConditionInversion](#avoidconditioninversion)|complexity|sevntu||
|
[AvoidConditionInversion](#avoidconditioninversion)|complexity|sevntu||
|
||||||
[AvoidConstantAsFirstOperandInCondition](#avoidconstantasfirstoperandincondition)|tweaks|sevntu|Yes|
|
[AvoidConstantAsFirstOperandInCondition](#avoidconstantasfirstoperandincondition)|tweaks|sevntu|Yes|
|
||||||
[AvoidDefaultSerializableInInnerClasses](#avoiddefaultserializableininnerclasses)|tweaks|sevntu|Yes|
|
[AvoidDefaultSerializableInInnerClasses](#avoiddefaultserializableininnerclasses)|tweaks|sevntu|Yes|
|
||||||
|
[AvoidDoubleBraceInitialization](#avoiddoublebraceinitialization)|tweaks|checkstyle|Yes|
|
||||||
[AvoidEscapedUnicodeCharacters](#avoidescapedunicodecharacters)|tweaks|checkstyle|Yes|
|
[AvoidEscapedUnicodeCharacters](#avoidescapedunicodecharacters)|tweaks|checkstyle|Yes|
|
||||||
[AvoidHidingCauseException](#avoidhidingcauseexception)|tweaks|sevntu|Yes|
|
[AvoidHidingCauseException](#avoidhidingcauseexception)|tweaks|sevntu|Yes|
|
||||||
[AvoidInlineConditionals](#avoidinlineconditionals)|complexity|checkstyle|Yes|
|
[AvoidInlineConditionals](#avoidinlineconditionals)|complexity|checkstyle|Yes|
|
||||||
[AvoidModifiersForTypes](#avoidmodifiersfortypes)|unspecified|sevntu||
|
[AvoidModifiersForTypes](#avoidmodifiersfortypes)|unspecified|sevntu||
|
||||||
[AvoidNestedBlocks](#avoidnestedblocks)|complexity|checkstyle|Yes|
|
[AvoidNestedBlocks](#avoidnestedblocks)|complexity|checkstyle|Yes|
|
||||||
|
[AvoidNoArgumentSuperConstructorCall](#avoidnoargumentsuperconstructorcall)|tweaks|checkstyle|Yes|
|
||||||
[AvoidNotShortCircuitOperatorsForBoolean](#avoidnotshortcircuitoperatorsforboolean)|tweaks|sevntu|Yes|
|
[AvoidNotShortCircuitOperatorsForBoolean](#avoidnotshortcircuitoperatorsforboolean)|tweaks|sevntu|Yes|
|
||||||
[AvoidStarImport](#avoidstarimport)|layout|checkstyle||
|
[AvoidStarImport](#avoidstarimport)|layout|checkstyle||
|
||||||
[AvoidStaticImport](#avoidstaticimport)|complexity|checkstyle||
|
[AvoidStaticImport](#avoidstaticimport)|complexity|checkstyle||
|
||||||
|
@ -164,7 +166,8 @@ Rule|Level|Source|Enabled|Suppressible
|
||||||
[InterfaceMemberImpliedModifier](#interfacememberimpliedmodifier)|tweaks|checkstyle||
|
[InterfaceMemberImpliedModifier](#interfacememberimpliedmodifier)|tweaks|checkstyle||
|
||||||
[InterfaceTypeParameterName](#interfacetypeparametername)|naming|checkstyle|Yes|
|
[InterfaceTypeParameterName](#interfacetypeparametername)|naming|checkstyle|Yes|
|
||||||
[JavadocMethod](#javadocmethod)|javadoc|checkstyle||
|
[JavadocMethod](#javadocmethod)|javadoc|checkstyle||
|
||||||
[JavadocMissingLeadingAsterisk](#javadocmissingleadingasterisk)|layout|checkstyle|Yes|
|
[JavadocMissingLeadingAsterisk](#javadocmissingleadingasterisk)|javadoc|checkstyle|Yes|
|
||||||
|
[JavadocMissingWhitespaceAfterAsterisk](#javadocmissingwhitespaceafterasterisk)|javadoc|checkstyle|Yes|
|
||||||
[JavadocPackage](#javadocpackage)|javadoc|checkstyle|Yes|
|
[JavadocPackage](#javadocpackage)|javadoc|checkstyle|Yes|
|
||||||
[JavadocParagraph](#javadocparagraph)|javadoc|checkstyle|Yes|
|
[JavadocParagraph](#javadocparagraph)|javadoc|checkstyle|Yes|
|
||||||
[JavadocStyle](#javadocstyle)|javadoc|checkstyle|Yes|
|
[JavadocStyle](#javadocstyle)|javadoc|checkstyle|Yes|
|
||||||
|
@ -273,6 +276,7 @@ Rule|Level|Source|Enabled|Suppressible
|
||||||
[UniformEnumConstantName](#uniformenumconstantname)|naming|sevntu|Yes|
|
[UniformEnumConstantName](#uniformenumconstantname)|naming|sevntu|Yes|
|
||||||
[UniqueProperties](#uniqueproperties)|javadoc|checkstyle|Yes|
|
[UniqueProperties](#uniqueproperties)|javadoc|checkstyle|Yes|
|
||||||
[UnnecessaryParentheses](#unnecessaryparentheses)|layout|checkstyle|Yes|
|
[UnnecessaryParentheses](#unnecessaryparentheses)|layout|checkstyle|Yes|
|
||||||
|
[UnnecessarySemicolonAfterOuterTypeDeclaration](#unnecessarysemicolonafteroutertypedeclaration)|layout|checkstyle|Yes|
|
||||||
[UnusedImports](#unusedimports)|layout|checkstyle|Yes|
|
[UnusedImports](#unusedimports)|layout|checkstyle|Yes|
|
||||||
[UpperEll](#upperell)|layout|checkstyle|Yes|
|
[UpperEll](#upperell)|layout|checkstyle|Yes|
|
||||||
[UselessSingleCatch](#uselesssinglecatch)|tweaks|sevntu|Yes|
|
[UselessSingleCatch](#uselesssinglecatch)|tweaks|sevntu|Yes|
|
||||||
|
@ -379,6 +383,38 @@ Javadoc `@` clauses must be in the order:
|
||||||
* @deprecated ...
|
* @deprecated ...
|
||||||
*/
|
*/
|
||||||
````
|
````
|
||||||
|
#### [AvoidDoubleBraceInitialization](https://checkstyle.sourceforge.io/config_coding.html#AvoidDoubleBraceInitialization)
|
||||||
|
|
||||||
|
Detects double brace initialization.
|
||||||
|
|
||||||
|
Rationale: Double brace initialization (set of Instance Initializers in class
|
||||||
|
body) may look cool, but it is considered as anti-pattern and should be avoided.
|
||||||
|
This is also can lead to a hard-to-detect memory leak, if the anonymous class
|
||||||
|
instance is returned outside and other object(s) hold reference to it. Created
|
||||||
|
anonymous class is not static, it holds an implicit reference to the outer class
|
||||||
|
instance. See this
|
||||||
|
[blog post](https://blog.jooq.org/2014/12/08/dont-be-clever-the-double-curly-braces-anti-pattern/)
|
||||||
|
and
|
||||||
|
[article](https://www.baeldung.com/java-double-brace-initialization)
|
||||||
|
for more details. Check ignores any comments and semicolons in class body.
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class MyClass {
|
||||||
|
List<Integer> list1 = new ArrayList<>() { // violation
|
||||||
|
{
|
||||||
|
add(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
List<String> list2 = new ArrayList<>() { // violation
|
||||||
|
;
|
||||||
|
// comments and semicolons are ignored
|
||||||
|
{
|
||||||
|
add("foo");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
````
|
||||||
#### [AvoidEscapedUnicodeCharacters](http://checkstyle.sourceforge.net/config_misc.html#AvoidEscapedUnicodeCharacters)
|
#### [AvoidEscapedUnicodeCharacters](http://checkstyle.sourceforge.net/config_misc.html#AvoidEscapedUnicodeCharacters)
|
||||||
|
|
||||||
Prevents use of obscure escape codes (e.g. `\u221e`). However, non-printable/control characters are still permitted.
|
Prevents use of obscure escape codes (e.g. `\u221e`). However, non-printable/control characters are still permitted.
|
||||||
|
@ -414,6 +450,34 @@ Invalid:
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
````
|
````
|
||||||
|
#### [AvoidNoArgumentSuperConstructorCall](https://checkstyle.sourceforge.io/config_coding.html#AvoidNoArgumentSuperConstructorCall)
|
||||||
|
|
||||||
|
Checks if call to superclass constructor without arguments is present. Such invocation is redundant
|
||||||
|
because constructor body implicitly begins with a superclass constructor invocation super();
|
||||||
|
See
|
||||||
|
[specification](https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-8.8.7)
|
||||||
|
for detailed information.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````java
|
||||||
|
class MyClass extends SomeOtherClass {
|
||||||
|
MyClass(int arg) {
|
||||||
|
super(arg); // OK, call with argument have to be explicit
|
||||||
|
}
|
||||||
|
MyClass(long arg) {
|
||||||
|
// OK, call is implicit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class MyClass extends SomeOtherClass {
|
||||||
|
MyClass() {
|
||||||
|
super(); // violation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
||||||
#### [BooleanExpressionComplexity](http://checkstyle.sourceforge.net/config_metrics.html#BooleanExpressionComplexity)
|
#### [BooleanExpressionComplexity](http://checkstyle.sourceforge.net/config_metrics.html#BooleanExpressionComplexity)
|
||||||
|
|
||||||
Restrict the number of number of &&, ||, &, | and ^ in an expression to 2.
|
Restrict the number of number of &&, ||, &, | and ^ in an expression to 2.
|
||||||
|
@ -1183,6 +1247,40 @@ class Wrapped {}
|
||||||
*/
|
*/
|
||||||
class Code {}
|
class Code {}
|
||||||
````
|
````
|
||||||
|
#### [JavadocMissingWhitespaceAfterAsterisk](https://checkstyle.sourceforge.io/config_javadoc.html#JavadocMissingWhitespaceAfterAsterisk)
|
||||||
|
|
||||||
|
Checks that there is at least one whitespace after the leading asterisk.
|
||||||
|
Although spaces after asterisks are optional in the Javadoc comments, their
|
||||||
|
absence makes the documentation difficult to read. It is the de facto standard
|
||||||
|
to put at least one whitespace after the leading asterisk.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````java
|
||||||
|
/** This is valid single-line Javadoc. */
|
||||||
|
class TestClass {
|
||||||
|
/**
|
||||||
|
* This is valid Javadoc.
|
||||||
|
*/
|
||||||
|
void validJavaDocMethod() {
|
||||||
|
}
|
||||||
|
/** This is valid single-line Javadoc. */
|
||||||
|
void validSingleLineJavaDocMethod() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class TestClass {
|
||||||
|
/**
|
||||||
|
*This is invalid Javadoc.
|
||||||
|
*/
|
||||||
|
int invalidJavaDoc;
|
||||||
|
/**This is invalid single-line Javadoc. */
|
||||||
|
void invalidSingleLineJavaDocMethod() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
||||||
#### [JavadocPackage](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage)
|
#### [JavadocPackage](http://checkstyle.sourceforge.net/config_javadoc.html#JavadocPackage)
|
||||||
|
|
||||||
Checks that each package has a `package-info.java` file.
|
Checks that each package has a `package-info.java` file.
|
||||||
|
@ -2099,6 +2197,55 @@ Invalid:
|
||||||
````
|
````
|
||||||
if ((a < 1)) {}
|
if ((a < 1)) {}
|
||||||
````
|
````
|
||||||
|
#### [UnnecessarySemicolonAfterOuterTypeDeclaration](https://checkstyle.sourceforge.io/config_coding.html#UnnecessarySemicolonAfterOuterTypeDeclaration)
|
||||||
|
|
||||||
|
Checks if unnecessary semicolon is used after type declaration.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````java
|
||||||
|
class A {
|
||||||
|
|
||||||
|
class Nested {
|
||||||
|
|
||||||
|
}; // OK, nested type declarations are ignored
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
enum C {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@interface D {
|
||||||
|
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class A {
|
||||||
|
|
||||||
|
class Nested {
|
||||||
|
|
||||||
|
}; // OK, nested type declarations are ignored
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
|
||||||
|
enum C {
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
|
||||||
|
@interface D {
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
````
|
||||||
#### [UnusedImports](http://checkstyle.sourceforge.net/config_imports.html#UnusedImports)
|
#### [UnusedImports](http://checkstyle.sourceforge.net/config_imports.html#UnusedImports)
|
||||||
|
|
||||||
Checks for unused imports. Does not inspect wildcard imports, which should be blocked by [AvoidStarImport](#avoidstarimport) anyway.
|
Checks for unused imports. Does not inspect wildcard imports, which should be blocked by [AvoidStarImport](#avoidstarimport) anyway.
|
||||||
|
|
|
@ -24,17 +24,17 @@
|
||||||
<tiles-maven-plugin.version>2.23</tiles-maven-plugin.version>
|
<tiles-maven-plugin.version>2.23</tiles-maven-plugin.version>
|
||||||
<kemitix-maven-tiles.version>3.1.1</kemitix-maven-tiles.version>
|
<kemitix-maven-tiles.version>3.1.1</kemitix-maven-tiles.version>
|
||||||
|
|
||||||
<checkstyle.version>8.45</checkstyle.version>
|
<checkstyle.version>8.45.1</checkstyle.version>
|
||||||
<sevntu.version>1.40.0</sevntu.version>
|
<sevntu.version>1.40.0</sevntu.version>
|
||||||
<sevntu-plugin.version>1.35.0</sevntu-plugin.version>
|
<sevntu-plugin.version>1.35.0</sevntu-plugin.version>
|
||||||
<lombok.version>1.18.20</lombok.version>
|
<lombok.version>1.18.24</lombok.version>
|
||||||
<spring-platform.version>Brussels-SR6</spring-platform.version>
|
<spring-platform.version>Brussels-SR6</spring-platform.version>
|
||||||
<spring-boot.version>2.7.4</spring-boot.version>
|
<spring-boot.version>2.7.4</spring-boot.version>
|
||||||
<mapstream.version>3.2.10</mapstream.version>
|
<mapstream.version>3.2.10</mapstream.version>
|
||||||
<map-builder.version>1.0.0</map-builder.version>
|
<map-builder.version>1.0.0</map-builder.version>
|
||||||
<mockito.version>3.11.2</mockito.version>
|
<mockito.version>4.8.0</mockito.version>
|
||||||
<assertj.version>3.20.2</assertj.version>
|
<assertj.version>3.20.2</assertj.version>
|
||||||
<classgraph.version>4.8.113</classgraph.version>
|
<classgraph.version>4.8.149</classgraph.version>
|
||||||
|
|
||||||
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
|
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
|
||||||
<kemitix.checkstyle.ruleset.version>${project.version}</kemitix.checkstyle.ruleset.version>
|
<kemitix.checkstyle.ruleset.version>${project.version}</kemitix.checkstyle.ruleset.version>
|
||||||
|
|
|
@ -1548,7 +1548,7 @@ rules:
|
||||||
-
|
-
|
||||||
name: JavadocMissingLeadingAsterisk
|
name: JavadocMissingLeadingAsterisk
|
||||||
parent: TREEWALKER
|
parent: TREEWALKER
|
||||||
level: LAYOUT
|
level: JAVADOC
|
||||||
enabled: true
|
enabled: true
|
||||||
source: CHECKSTYLE
|
source: CHECKSTYLE
|
||||||
uri: https://checkstyle.sourceforge.io/config_javadoc.html#JavadocMissingLeadingAsterisk
|
uri: https://checkstyle.sourceforge.io/config_javadoc.html#JavadocMissingLeadingAsterisk
|
||||||
|
@ -1566,4 +1566,31 @@ rules:
|
||||||
enabled: true
|
enabled: true
|
||||||
source: CHECKSTYLE
|
source: CHECKSTYLE
|
||||||
uri: https://checkstyle.sourceforge.io/config_misc.html#NoCodeInFile
|
uri: https://checkstyle.sourceforge.io/config_misc.html#NoCodeInFile
|
||||||
|
-
|
||||||
|
name: JavadocMissingWhitespaceAfterAsterisk
|
||||||
|
parent: TREEWALKER
|
||||||
|
level: JAVADOC
|
||||||
|
enabled: true
|
||||||
|
source: CHECKSTYLE
|
||||||
|
uri: https://checkstyle.sourceforge.io/config_javadoc.html#JavadocMissingWhitespaceAfterAsterisk
|
||||||
|
-
|
||||||
|
name: UnnecessarySemicolonAfterOuterTypeDeclaration
|
||||||
|
parent: TREEWALKER
|
||||||
|
level: LAYOUT
|
||||||
|
enabled: true
|
||||||
|
source: CHECKSTYLE
|
||||||
|
uri: https://checkstyle.sourceforge.io/config_coding.html#UnnecessarySemicolonAfterOuterTypeDeclaration
|
||||||
|
-
|
||||||
|
name: AvoidDoubleBraceInitialization
|
||||||
|
parent: TREEWALKER
|
||||||
|
level: TWEAKS
|
||||||
|
enabled: true
|
||||||
|
source: CHECKSTYLE
|
||||||
|
uri: https://checkstyle.sourceforge.io/config_coding.html#AvoidDoubleBraceInitialization
|
||||||
|
-
|
||||||
|
name: AvoidNoArgumentSuperConstructorCall
|
||||||
|
parent: TREEWALKER
|
||||||
|
level: TWEAKS
|
||||||
|
enabled: true
|
||||||
|
source: CHECKSTYLE
|
||||||
|
uri: https://checkstyle.sourceforge.io/config_coding.html#AvoidNoArgumentSuperConstructorCall
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
Detects double brace initialization.
|
||||||
|
|
||||||
|
Rationale: Double brace initialization (set of Instance Initializers in class
|
||||||
|
body) may look cool, but it is considered as anti-pattern and should be avoided.
|
||||||
|
This is also can lead to a hard-to-detect memory leak, if the anonymous class
|
||||||
|
instance is returned outside and other object(s) hold reference to it. Created
|
||||||
|
anonymous class is not static, it holds an implicit reference to the outer class
|
||||||
|
instance. See this
|
||||||
|
[blog post](https://blog.jooq.org/2014/12/08/dont-be-clever-the-double-curly-braces-anti-pattern/)
|
||||||
|
and
|
||||||
|
[article](https://www.baeldung.com/java-double-brace-initialization)
|
||||||
|
for more details. Check ignores any comments and semicolons in class body.
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class MyClass {
|
||||||
|
List<Integer> list1 = new ArrayList<>() { // violation
|
||||||
|
{
|
||||||
|
add(1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
List<String> list2 = new ArrayList<>() { // violation
|
||||||
|
;
|
||||||
|
// comments and semicolons are ignored
|
||||||
|
{
|
||||||
|
add("foo");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
````
|
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
Checks if call to superclass constructor without arguments is present. Such invocation is redundant
|
||||||
|
because constructor body implicitly begins with a superclass constructor invocation super();
|
||||||
|
See
|
||||||
|
[specification](https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-8.8.7)
|
||||||
|
for detailed information.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````java
|
||||||
|
class MyClass extends SomeOtherClass {
|
||||||
|
MyClass(int arg) {
|
||||||
|
super(arg); // OK, call with argument have to be explicit
|
||||||
|
}
|
||||||
|
MyClass(long arg) {
|
||||||
|
// OK, call is implicit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class MyClass extends SomeOtherClass {
|
||||||
|
MyClass() {
|
||||||
|
super(); // violation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
Checks that there is at least one whitespace after the leading asterisk.
|
||||||
|
Although spaces after asterisks are optional in the Javadoc comments, their
|
||||||
|
absence makes the documentation difficult to read. It is the de facto standard
|
||||||
|
to put at least one whitespace after the leading asterisk.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````java
|
||||||
|
/** This is valid single-line Javadoc. */
|
||||||
|
class TestClass {
|
||||||
|
/**
|
||||||
|
* This is valid Javadoc.
|
||||||
|
*/
|
||||||
|
void validJavaDocMethod() {
|
||||||
|
}
|
||||||
|
/** This is valid single-line Javadoc. */
|
||||||
|
void validSingleLineJavaDocMethod() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class TestClass {
|
||||||
|
/**
|
||||||
|
*This is invalid Javadoc.
|
||||||
|
*/
|
||||||
|
int invalidJavaDoc;
|
||||||
|
/**This is invalid single-line Javadoc. */
|
||||||
|
void invalidSingleLineJavaDocMethod() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
````
|
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
Checks if unnecessary semicolon is used after type declaration.
|
||||||
|
|
||||||
|
Valid:
|
||||||
|
````java
|
||||||
|
class A {
|
||||||
|
|
||||||
|
class Nested {
|
||||||
|
|
||||||
|
}; // OK, nested type declarations are ignored
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
enum C {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@interface D {
|
||||||
|
|
||||||
|
}
|
||||||
|
````
|
||||||
|
|
||||||
|
Invalid:
|
||||||
|
````java
|
||||||
|
class A {
|
||||||
|
|
||||||
|
class Nested {
|
||||||
|
|
||||||
|
}; // OK, nested type declarations are ignored
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
|
||||||
|
enum C {
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
|
||||||
|
@interface D {
|
||||||
|
|
||||||
|
}; // violation
|
||||||
|
````
|
|
@ -53,8 +53,8 @@
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -80,8 +80,8 @@
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,8 @@
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,10 @@
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.whitespace.NoWhitespaceBeforeCaseDefaultColonCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.AvoidDoubleBraceInitializationCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.AvoidNoArgumentSuperConstructorCallCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -191,6 +191,10 @@
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LambdaBodyLengthCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LambdaBodyLengthCheck"/>
|
||||||
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
<module name="com.puppycrawl.tools.checkstyle.checks.NoCodeInFileCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.UnnecessarySemicolonAfterOuterTypeDeclarationCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.AvoidDoubleBraceInitializationCheck"/>
|
||||||
|
<module name="com.puppycrawl.tools.checkstyle.checks.coding.AvoidNoArgumentSuperConstructorCallCheck"/>
|
||||||
|
|
||||||
</module><!-- /TreeWalker -->
|
</module><!-- /TreeWalker -->
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
<kemitix-maven-tiles.version>3.1.1</kemitix-maven-tiles.version>
|
<kemitix-maven-tiles.version>3.1.1</kemitix-maven-tiles.version>
|
||||||
|
|
||||||
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
|
<maven-checkstyle-plugin.version>3.1.2</maven-checkstyle-plugin.version>
|
||||||
<checkstyle.version>8.45</checkstyle.version>
|
<checkstyle.version>8.45.1</checkstyle.version>
|
||||||
<sevntu.version>1.35.0</sevntu.version>
|
<sevntu.version>1.35.0</sevntu.version>
|
||||||
|
|
||||||
<kemitix.checkstyle.ruleset.version>${project.version}</kemitix.checkstyle.ruleset.version>
|
<kemitix.checkstyle.ruleset.version>${project.version}</kemitix.checkstyle.ruleset.version>
|
||||||
|
|
Loading…
Reference in a new issue