Code Formatting and CheckStyle
Introduction
Pentaho enforces coding standards and style through the CheckStyle project ( http://checkstyle.sf.net ). Our CheckStyle template and installation instructions are located up on GitHub at: https://github.com/pentaho/pentaho-coding-standards
The following is taken from the pentaho-coding-standards repository:
CheckStyle will soon be integrated into our build system. Until that time, you'll need to configure your IDE using the instructions below to to ensure your contributions conform to the standard.
Installation (Eclipse):
- Install CheckStyle plugin http://eclipse-cs.sf.net/update/
- Clone the https://github.com/pentaho/pentaho-coding-standards to your machine.
- Configure the plugin to use the pentaho_checkStyle.xml
- Configure the Eclipse Code Formatter to use the attached pentaho_formatter.xml
- The Eclipse CheckStyle plugin documentation my be helpful: http://eclipse-cs.sourceforge.net
Installation (IntelliJ):
- Install the CheckStyle-IDEA plugin. (available in the default public repository)
- Clone the https://github.com/pentaho/pentaho-coding-standards to your machine.
- Configure the CheckStyle-IDEA with pentaho_checkStyle.xml.
- Copy the codeStyleSettings.xml into your IntelliJ project folder (
IdeaIntelliJProjectFolder
/.idea/codeStyleSettings.xml). Overwrite if it's already there. - Open IntelliJ, set the Project Settings -> Code Style -> Scheme to "Project"
Additional Information
Learn how to suppress CheckStyle modules for select areas: CheckStyle Tips