checkstyle / checkstyle
Checkstyle / Checkstyle
Checkstyle - Java Code Quality Tool Checkstyle 是一款确保代码遵循特定标准或最佳实践的工具。
Checkstyle is a tool that ensures adherence to a code standard or a set of best practices. The latest release version can be found at GitHub releases or at Maven repo. Documentation is available in HTML format, see Checkstyle checks. The latest deployed website from master is available here. 最新发布版本可在 GitHub Releases 或 Maven 仓库中找到。文档以 HTML 格式提供,请参阅 Checkstyle checks。从 master 分支部署的最新网站可在此处访问。
Table of Contents 目录
- Quick Start 快速入门
- Contributing 贡献指南
- Feedback and Support 反馈与支持
- Javadoc Javadoc 文档
- Sponsor Checkstyle 赞助 Checkstyle
- Licensing 许可协议
Quick Start 快速入门
Download our Latest Release from GitHub or add Checkstyle to your build from Maven Central. Read our Documentation for usage and configuration. 从 GitHub 下载我们的最新版本,或通过 Maven Central 将 Checkstyle 添加到您的构建中。请阅读我们的文档以了解使用和配置方法。
$ cat config.xml
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<module name="FallThrough"/>
</module>
</module>
$ cat Test.java
class Test {
public void foo() {
int i = 0;
while (i >= 0) {
switch (i) {
case 1:
case 2:
i++;
case 3: // violation 'fall from previous branch of the switch'
i++;
}
}
}
}
$ java -jar checkstyle-10.18.1-all.jar -c config.xml Test.java
Starting audit...
[ERROR] Test.java:9:9: Fall through from previous branch of switch statement [FallThrough]
Audit done.
Checkstyle ends with 1 errors.
Contributing 贡献指南
Thanks for your interest in contributing to CheckStyle! Please see the Contribution Guidelines for information on how to contribute to the project. This includes creating issues, submitting pull requests, and setting up your development environment. 感谢您有兴趣为 CheckStyle 做出贡献!请参阅《贡献指南》以了解如何参与本项目,包括创建 Issue、提交 Pull Request 以及配置开发环境。
Build Instructions 构建说明
Please see the Build Instructions for information on how to build the project. 请参阅《构建说明》以了解如何构建本项目。
Feedback and Support 反馈与支持
Visit our Discussions Page, where you can ask questions and discuss the project with other users and contributors. This is our preferred method of communication for topics like usage and configuration questions, debugging, and other feedback. Stack Overflow is another place to ask questions about Checkstyle usage. If you are interested in contributing to the project, you can join our Discord Contributors Chat with invite link. Our Google Groups Forum is a mailing list for discussion and support; however, we may be slow to respond there. 请访问我们的讨论页面(Discussions Page),您可以在那里提问并与其他用户及贡献者讨论项目。对于使用、配置、调试及其他反馈等话题,这是我们首选的沟通方式。Stack Overflow 是另一个可以询问 Checkstyle 使用问题的平台。如果您有兴趣为项目做贡献,可以通过邀请链接加入我们的 Discord 贡献者聊天室。我们的 Google Groups 论坛是一个用于讨论和支持的邮件列表;但我们在那里的响应速度可能较慢。
Javadoc Javadoc 文档
Take a look at our javadoc to see our API documentation. 请查看我们的 Javadoc 以获取 API 文档。
Sponsor Checkstyle 赞助 Checkstyle
Checkstyle is an open-source project that is developed and maintained by volunteers. If you find Checkstyle useful, please consider sponsoring the project. Your support helps us to maintain and improve Checkstyle. Checkstyle 是一个由志愿者开发和维护的开源项目。如果您觉得 Checkstyle 有用,请考虑赞助本项目。您的支持将帮助我们维护和改进 Checkstyle。
Liberapay / OpenCollective
Licensing 许可协议
Checkstyle is licensed under the GNU LGPL v2.1 License. Checkstyle uses libraries: ANTLR, Apache Commons, Google Guava, Picocli. Checkstyle 基于 GNU LGPL v2.1 许可证发布。Checkstyle 使用了以下库:ANTLR、Apache Commons、Google Guava、Picocli。
Development Tools Powered by 开发工具支持: