Add UnnecessarySemicolonAfterOuterTypeDeclaration
commit-id:e9b3967d
This commit is contained in:
parent
82868e9632
commit
767937448f
8 changed files with 110 additions and 0 deletions
50
README.md
50
README.md
|
@ -274,6 +274,7 @@ Rule|Level|Source|Enabled|Suppressible
|
|||
[UniformEnumConstantName](#uniformenumconstantname)|naming|sevntu|Yes|
|
||||
[UniqueProperties](#uniqueproperties)|javadoc|checkstyle|Yes|
|
||||
[UnnecessaryParentheses](#unnecessaryparentheses)|layout|checkstyle|Yes|
|
||||
[UnnecessarySemicolonAfterOuterTypeDeclaration](#unnecessarysemicolonafteroutertypedeclaration)|layout|checkstyle|Yes|
|
||||
[UnusedImports](#unusedimports)|layout|checkstyle|Yes|
|
||||
[UpperEll](#upperell)|layout|checkstyle|Yes|
|
||||
[UselessSingleCatch](#uselesssinglecatch)|tweaks|sevntu|Yes|
|
||||
|
@ -2134,6 +2135,55 @@ Invalid:
|
|||
````
|
||||
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)
|
||||
|
||||
Checks for unused imports. Does not inspect wildcard imports, which should be blocked by [AvoidStarImport](#avoidstarimport) anyway.
|
||||
|
|
|
@ -1573,3 +1573,10 @@ rules:
|
|||
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
|
||||
|
|
|
@ -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
|
||||
````
|
|
@ -56,6 +56,7 @@
|
|||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
||||
<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 -->
|
||||
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
||||
<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 -->
|
||||
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
||||
<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 -->
|
||||
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingLeadingAsteriskCheck"/>
|
||||
<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 -->
|
||||
|
||||
|
|
|
@ -192,6 +192,7 @@
|
|||
<module name="com.puppycrawl.tools.checkstyle.checks.sizes.LambdaBodyLengthCheck"/>
|
||||
<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 -->
|
||||
|
||||
|
|
Loading…
Reference in a new issue