如果我没有定义 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>
最佳答案
默认配置使用 sun_checks.xml
中预定义的规则集“Sun Microsystems Definition”,请参阅 Maven Checkstyle Plugin docs :
There are 2 predefined Checkstyle configuration definitions that ship with the Checkstyle Plugin, the Sun Microsystems Definition is selected by default.
- sun_checks.xml - Sun Microsystems Definition (default).
- google_checks.xml - Google Definition.
规则集的内容可以在 Checkstyle's GitHub repository 找到.
关于java - checkstyle 使用的默认规则是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58399346/