Add JavadocMissingWhitespaceAfterAsterisk
commit-id:2bb16049
This commit is contained in:
parent
1deee25d96
commit
82868e9632
8 changed files with 80 additions and 1 deletions
35
README.md
35
README.md
|
@ -165,6 +165,7 @@ Rule|Level|Source|Enabled|Suppressible
|
|||
[InterfaceTypeParameterName](#interfacetypeparametername)|naming|checkstyle|Yes|
|
||||
[JavadocMethod](#javadocmethod)|javadoc|checkstyle||
|
||||
[JavadocMissingLeadingAsterisk](#javadocmissingleadingasterisk)|layout|checkstyle|Yes|
|
||||
[JavadocMissingWhitespaceAfterAsterisk](#javadocmissingwhitespaceafterasterisk)|layout|checkstyle|Yes|
|
||||
[JavadocPackage](#javadocpackage)|javadoc|checkstyle|Yes|
|
||||
[JavadocParagraph](#javadocparagraph)|javadoc|checkstyle|Yes|
|
||||
[JavadocStyle](#javadocstyle)|javadoc|checkstyle|Yes|
|
||||
|
@ -1183,6 +1184,40 @@ class Wrapped {}
|
|||
*/
|
||||
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)
|
||||
|
||||
Checks that each package has a `package-info.java` file.
|
||||
|
|
|
@ -1566,4 +1566,10 @@ rules:
|
|||
enabled: true
|
||||
source: CHECKSTYLE
|
||||
uri: https://checkstyle.sourceforge.io/config_misc.html#NoCodeInFile
|
||||
|
||||
-
|
||||
name: JavadocMissingWhitespaceAfterAsterisk
|
||||
parent: TREEWALKER
|
||||
level: LAYOUT
|
||||
enabled: true
|
||||
source: CHECKSTYLE
|
||||
uri: https://checkstyle.sourceforge.io/config_javadoc.html#JavadocMissingWhitespaceAfterAsterisk
|
||||
|
|
|
@ -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() {
|
||||
}
|
||||
}
|
||||
````
|
|
@ -55,6 +55,7 @@
|
|||
<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.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||
|
||||
</module><!-- /TreeWalker -->
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@
|
|||
<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.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||
|
||||
</module><!-- /TreeWalker -->
|
||||
|
||||
|
|
|
@ -101,6 +101,7 @@
|
|||
<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.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||
|
||||
</module><!-- /TreeWalker -->
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@
|
|||
<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.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||
|
||||
</module><!-- /TreeWalker -->
|
||||
|
||||
|
|
|
@ -191,6 +191,7 @@
|
|||
<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.NoCodeInFileCheck"/>
|
||||
<module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMissingWhitespaceAfterAsteriskCheck"/>
|
||||
|
||||
</module><!-- /TreeWalker -->
|
||||
|
||||
|
|
Loading…
Reference in a new issue