Skip to content

Coding Standards

Ziv Izhar edited this page Apr 21, 2017 · 1 revision

Environment

  • Latest JDK8
  • Latest Eclipse
  • Latest Spartanizer plugin

Spartanizer

Disable the followings:

  • Dollarizations
  • Centification
  • In-lining

Code

  • The Spartanizer forces our code in most cases, therefore, there are few things to remeber.
  • Do not exceed 80 characters in a line. Breaking lines will be as described in here Line Wraping
  • Naming - Variables and Function names should be named in camelCase
  • Curly Brackets
    • In if and for's, use the following style (it's java here, not c#)
      if (true) {
          statements;
      }
      
    • Do not use curly brackets when you don't need to, for example:
      if (true)
          statement;
      
  • Identation - use only tabs
  • When you are not sure what style you should write in - be consistent with the current file/package.

Documentation

  • Explain any non-trivial code
  • Explain any function
  • Include @author and @since in every class you create

Before commiting:

Make sure:

  • There are no errors
  • There are no warnings
  • The tests pass locally

While commiting:

  • Make sure your commit comment explains clearly what the commit is about
  • Remember to include the issue number in the comment

After commiting:

  • You should check travis to make sure you didn't break the project

Clone this wiki locally