![](/img/trans.png)
[英]How to configure the Eclipse Checkstyle plugin to use the same rules used by the maven-checkstyle-plugin
[英]What are the default rules used by checkstyle?
如果我没有定义 checkstyle 配置,则默认执行几个 checkstyle 规则,是否有 checkstyle 使用的默认规则列表?
这就是我的 maven 配置的样子:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<failOnViolation>true</failOnViolation>
<consoleOutput>true</consoleOutput>
<logViolationsToConsole>true</logViolationsToConsole>
</configuration>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
You can find the rules on official github https://github.com/checkstyle/checkstyle/tree/master/src/main/resources and read the descriptions on the official website https://checkstyle.sourceforge.io/checks.html
默认配置使用 sun_checks.xml 中的预定义规则集“Sun Microsystems Definition”,请参阅sun_checks.xml
Checkstyle Plugin 文档:
Checkstyle 插件附带了 2 个预定义的 Checkstyle 配置定义,默认选择 Sun Microsystems 定义。
- sun_checks.xml - Sun Microsystems 定义(默认)。
- google_checks.xml - 谷歌定义。
可以在Checkstyle 的 GitHub 存储库中找到规则集的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.