簡體   English   中英

checkstyle 使用的默認規則是什么?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM