Skip to content
Joe Gorman edited this page Jan 16, 2014 · 4 revisions

All Scala source code files will follow these conventions :

  1. Comment Convention

Use the three Scala comment types in the following ways.

 a) /** */ for Scaladoc, 

 b) /* */ for general or semantic descriptions, 

 c) // for implementation details
  1. Required file header

    a) Created By identifies the original author of the file

    b) Creation Date identifies when the file was first introduced

    c) Copyright

        i) Update the year as needed
    
       ii) Will always include Avrom Pfeffer and Charles River Analytics
    
      iii) Might include additional parties. Discuss with Avi before submitting a pull request
    

    d) Sample header from a file that Avi created.

/*

*/

  1. Package Statement format

    package com.cra.figaro.XXX

  2. Import Statements

    import java.lang.IllegalArgumentException

  3. ScalaDoc Description

/**

  • Evidence that can be associated with an element.

*/

  1. Constructor(s)

Each constructor should have a ScalaDoc header describing the purpose, parameters (if any), and return value (if any).

  1. Methods and Properties

Each public method should have a ScalaDoc header describing the purpose, parameters (if any), and return value (if any). Each property should have a short comment describing its purpose.

  1. Internal Formatting

Each file must follow the existing format established in files found in the project regarding indentation, placement of curly braces, use of case, naming convention, etc.

  1. Import Statement Conventions

    a) Always use underscore,

    b) Rename to resolve name conflicts,

    c) Always use fully qualified package names