SpringJavadocCheck currently rejects any @return statement that begins with a capital letter.
|
private void checkTagCase(DetailAST ast, TextBlock javadoc) { |
|
String[] text = javadoc.getText(); |
|
for (int i = 0; i < text.length; i++) { |
|
for (Pattern pattern : CASE_CHECKED_TAG_PATTERNS) { |
|
Matcher matcher = pattern.matcher(text[i]); |
|
if (matcher.find()) { |
|
String description = matcher.group(1).trim(); |
|
if (startsWithUppercase(description)) { |
|
log(javadoc.getStartLineNo() + i, text[i].length() - description.length(), "javadoc.badCase"); |
|
} |
|
} |
|
} |
|
} |
|
} |
However, it is sometimes useful to be able to begin the statement with an acronym such as "HTML", "URL", "JNDI", "JNI", etc.
In Spring Framework, I recently changed Javadoc from@return jni hints to @return JNI hints, and that caused the build to fail.
To address that, I had to suppress SpringJavadocCheck for the entire affected class.
Thus, it would be nice if checkTagCase() allowed the first "word" to be all-caps (i.e., and acronym).
SpringJavadocCheckcurrently rejects any@returnstatement that begins with a capital letter.spring-javaformat/spring-javaformat/spring-javaformat-checkstyle/src/main/java/io/spring/javaformat/checkstyle/check/SpringJavadocCheck.java
Lines 149 to 162 in 4286438
However, it is sometimes useful to be able to begin the statement with an acronym such as "HTML", "URL", "JNDI", "JNI", etc.
In Spring Framework, I recently changed Javadoc from
@return jni hintsto@return JNI hints, and that caused the build to fail.To address that, I had to suppress
SpringJavadocCheckfor the entire affected class.Thus, it would be nice if
checkTagCase()allowed the first "word" to be all-caps (i.e., and acronym).