Skip to content

03. Coding conventions

Ilkka Seppälä edited this page Aug 19, 2017 · 7 revisions

Formatting

The code should be formatted according to Google Java Style Guide.

The coding conventions defined in checkstyle.xml are automatically checked with Maven Checkstyle plugin and the build fails if the conventions are not followed.

<!--checkstyle plug-in. checking against googles styles 
see config at checkstyle.xml-->
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-checkstyle-plugin</artifactId>
  <version>2.15</version>
  <executions>
    <execution>
      <id>validate</id>
      <goals>
        <goal>check</goal>
      </goals>
      <phase>validate</phase>
      <configuration>
        <configLocation>checkstyle.xml</configLocation>
        <encoding>UTF-8</encoding>
        <consoleOutput>true</consoleOutput>
        <failsOnError>true</failsOnError>
      </configuration>
    </execution>
  </executions>
</plugin>

Commit messages

The commit message should follow the pattern #ISSUENUMBER MESSAGE. For example #344 Add logger for output. In general you should always have an issue that the commit is trying to resolve.