diff --git a/builder/src/main/resources/application.yml b/builder/src/main/resources/application.yml index c371992..7b17881 100644 --- a/builder/src/main/resources/application.yml +++ b/builder/src/main/resources/application.yml @@ -1545,3 +1545,10 @@ rules: enabled: true source: CHECKSTYLE uri: https://checkstyle.sourceforge.io/config_whitespace.html#NoWhitespaceBeforeCaseDefaultColon + - + name: JavadocMissingLeadingAsterisk + parent: TREEWALKER + level: LAYOUT + enabled: true + source: CHECKSTYLE + uri: https://checkstyle.sourceforge.io/config_javadoc.html#JavadocMissingLeadingAsterisk diff --git a/builder/src/main/resources/rules/JavadocMissingLeadingAsterisk.md b/builder/src/main/resources/rules/JavadocMissingLeadingAsterisk.md new file mode 100644 index 0000000..ae3c54d --- /dev/null +++ b/builder/src/main/resources/rules/JavadocMissingLeadingAsterisk.md @@ -0,0 +1,50 @@ + +Checks if the javadoc has leading asterisks on each line. + +The check does not require asterisks on the first line, nor on the last line if +it is blank. All other lines in a Javadoc should start with *, including blank +lines and code blocks. + +Valid: +```` +/** + * Valid Java-style comment. + * + *
+ * int value = 0; + *+ */ +class JavaStyle {} // ok + +/** Valid Scala-style comment. + * Some description here. + **/ +class ScalaStyle {} // ok + +/** ** + * Asterisks on first and last lines are optional. + * */ +class Asterisks {} // ok + +/** No asterisks are required for single-line comments. */ +class SingleLine {} // ok +```` + +Invalid: +```` +/** // violation on next blank line, javadoc has lines without leading asterisk. + + */ +class BlankLine {} + +/** Wrapped + single-line comment */ // violation, javadoc has lines without leading asterisk. +class Wrapped {} + +/** + *
+ int value; // violation, javadoc has lines without leading asterisk. + *+ */ +class Code {} +```` \ No newline at end of file