手册:代码编写约定/Java
此页面记载MediaWiki开发指引,由开发人员随着时间推移达成共识,精心制作而来(或有些时候由开发人员的领导公告而来) |
This page describes the coding conventions used within files of the MediaWiki codebase written in Java. See also the general conventions that apply to all program languages, including Java.
MediaWiki Java 代码的灵感来自 Google Java样式。 It differs at least in the following:
- indent with 4 spaces
A Checkstyle configuration file is used for verification by the Maven Checkstyle Plugin. This file is bundled in the discovery-maven-tool-configs project and can be used as a dependency as shown in the discovery-parent-pom project.
Various other conventions are embodied in the plugin configurations found in the discovery-parent-pom project. See the README.md in that project for additional documentation. You can use that parent pom directly, or pick the pieces which makes the most sense for a specific project.