LineLength 和 JavadocMethod 的 Checkstyle 错误
Checkstyle error with LineLength and JavadocMethod
昨天我在个人项目 (lifx-client) 中更新了 Gradle 包装器(至版本 6.1)。
在这个项目中我使用 Checkstyle 来验证代码上的一些规则。
更新任务 :checkstyleMain
失败并出现以下错误后:
$ ./gradlew checkstyleMain
> Task :checkstyleMain FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkstyleMain'.
> Unable to create Root Module: config {/Users/me/Projects/Miscellanea/
lifx-client/config/checkstyle/checkstyle.xml}, classpath { ...
在用 Checkstyle 配置文件做了一些测试后(你可以在 checkstyle.xml 看到它),我发现如果我注释掉模块,错误就消失了:
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
和
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingJavadoc" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override,Test,Before,Given,When,Then,And"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
关于此问题的任何提示and/or如何解决?
提前致谢。
您需要从您的 checkstyle 插件中找到 checkstyle 库的确切错误消息。
您很可能面临 checksyle 库中已知的破坏性兼容性更改。
请评论 https://checkstyle.org/releasenotes.html
搜索 "JavadocMethod" 和 "LineLength",打开相关的 Guthub 问题,您将看到 "Migration note" 说明如何升级配置以解决问题。
昨天我在个人项目 (lifx-client) 中更新了 Gradle 包装器(至版本 6.1)。
在这个项目中我使用 Checkstyle 来验证代码上的一些规则。
更新任务 :checkstyleMain
失败并出现以下错误后:
$ ./gradlew checkstyleMain
> Task :checkstyleMain FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkstyleMain'.
> Unable to create Root Module: config {/Users/me/Projects/Miscellanea/
lifx-client/config/checkstyle/checkstyle.xml}, classpath { ...
在用 Checkstyle 配置文件做了一些测试后(你可以在 checkstyle.xml 看到它),我发现如果我注释掉模块,错误就消失了:
<module name="LineLength">
<property name="max" value="120"/>
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
</module>
和
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingJavadoc" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="minLineCount" value="2"/>
<property name="allowedAnnotations" value="Override,Test,Before,Given,When,Then,And"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="tokens" value="METHOD_DEF"/>
</module>
关于此问题的任何提示and/or如何解决?
提前致谢。
您需要从您的 checkstyle 插件中找到 checkstyle 库的确切错误消息。
您很可能面临 checksyle 库中已知的破坏性兼容性更改。 请评论 https://checkstyle.org/releasenotes.html 搜索 "JavadocMethod" 和 "LineLength",打开相关的 Guthub 问题,您将看到 "Migration note" 说明如何升级配置以解决问题。