Help

Open an issue on Github or directly send an email to Julien Lamarre, Spincast lead developer.

We also plan on scanning for questions using the #spincast tag on Stack Overflow.

Developers

Source code

The open-source code is on Github and is Apache 2 licensed.

Contribution Guide

  • Contributions and suggestions are appreciated!
  • Use this Formatter (Eclipse export) or disable any automatic formatting in your IDE and follow our standards manually.
    • Instructions for Eclipse users
    • Instructions for IntelliJ IDEA users
    • Instructions for Netbeans users
    • If you use another IDE, or a plain text editor, look at the Spincast's core and default plugins and follow the same standards.
  • The max number of characters per line is 130. Use a widescreen monitor please.
  • Sometimes, formatters do crazy things and, other times, you simply don't want a section of your code to be automatically reformatted. In those situations, you can use // @formatter:off and // @formatter:on to disable the auto formatting:
    // @formatter:off
    String sql = "SELECT color " +
                 "FROM napoleon_horses " +
                 "WHERE color='white'";
    // @formatter:on
  • Unit/Integration tests are required.
  • Java 7 compatibility is required. No lambdas or other Java 8 specific constructs in the core and in the plugins.
  • Use Guice and make everything injectable and swappable.
  • Prefer short methods that can easily be overrided. If some part of a method could possibly be tweaked by a user, extract it to a separated method.
  • No private methods. Use protected for a method that shouldn't be public.
  • Member variables should be private, but a public or protected getter should exist for them.
  • Prefer constructor injection, with final member variables, when possible.
  • Avoid one-liners. Use meaningful variable names. Don't be afraid to be verbose if it makes your code easier to understand. "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. Code for readability."
  • Comments in code are encouraged. Use the standard /** comment */ style for the Javadoc. You can use this style for comments which are not Javadoc:

    //==========================================
    // This is a comment
    //==========================================
    String hello = "World";
    But regular comment style is ok too :
    // This is a comment
    String hello = "World";
  • All text based files must be UTF-8 encoded (except .properties files which should be ISO-8859-1)
  • In fact, use UTF-8 everywhere an encoding is involved!
  • Newlines are "\n". No Windows's "\r\n" newlines.
  • Always use braces, even for a single line if condition. Don't do this:
    if(someCondition)
        // no braces... :-(
  • Always assume a date to be UTC if no timezone is specified. If you need to store a date, store it as UTC. Only when displaying or outputting the date will you use the user's timezone, if available.
  • For your tests, try to use the same technic as the existing Spincast core tests. You probably want your test class to extend DefaultIntegrationTestingBase or, at least, SpincastGuiceBasedTestBase. Make sure you understand our custom SpincastJUnitRunner JUnit runner, which creates one instance of a test class only! For our unit tests, we often start an Undertow server instance even if it could be done without one: Undertow is very fast to boot.
  • Always keep the documentation in sync with your code.
If you're able to live with those decisions, you're good to go!
Thank you for your contributions!