Apache Shindig Code Style And Code Conventions

This document describes how developers and contributors should write code. The reasoning of these styles and conventions is mainly for consistency, readability and maintainability reasons.

Generic Code Style And Convention

All working files (java, xml, others) should respect the following conventions:

  • License Header: Always add the current ASF license header in all versionned files.
  • Trailing Whitespaces: Remove all trailing whitespaces. If your are an Eclipse user, you could use the Anyedit Eclipse Plugin.

and the following style:

  • Indentation: Never use tabs!
  • Line wrapping: Always use a 100-column line width.

Note: The specific styles and conventions, listed in the next sections, could override these generic rules.

Java

Java Code Style

The full Apache Shindig for Java is described in our Wiki.

Javadoc Code Convention

Our Javadoc code convention is mainly:

  • No author tag
  • No version tag

ongoing

Eclipse 3.2+

Download shindig-eclipse-codestyle_2.xml.

After this, select Window > Preferences, and open up the configuration for Java > Code Style > Code Formatter. Click on the button labeled Import... and select the file you downloaded. Give the style a name, and click OK.

Similarly, you could import shindig.importorder and shindig-eclipse-codetemplate.xml

PHP

TODO, see How to Contribute page