例如,我有下面的代码。我希望 checkstyle 提示,因为我的顶级 javadoc 注释和 @ 子句之间没有空行。
/**
* This line or the next line should fail checkstyle.
* @param param is essential
* @throws Exception is thrown when something bad happens
*/
当 javadoc 更改为如下所示时,Checkstyle 不应提示:
/**
* This line or the next line should no longer fail.
*
* @param param is essential
* @throws Exception is thrown when something bad happens
*/
我尝试使用 @Mureinik 的建议,它并没有提示我在第一段和 @-clauses 之间缺少空行。我验证了 Eclipse 已识别出我在下面的屏幕截图中启用了 JavadocParagraph。
<module name="JavadocParagraph"/>
最佳答案
JavadocParagraph
检查应确保。只需将以下内容添加到您的 checkstyle 配置中:
<module name="JavadocParagraph"/>
关于java - 当 javadoc 和 @param 之间没有空行时,如何使 checkstyle 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53125176/