-
Notifications
You must be signed in to change notification settings - Fork 154
Coding Policies
All Scala source code files will follow these conventions :
- 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
-
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.
/*
- Evidence.scala
- Evidence, and association of evidence with references.
- Created By: Avi Pfeffer ([email protected])
- Creation Date: Jan 1, 2013
- Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.
- See http://www.cra.com or email [email protected] for information.
- See http://www.github.com/p2t2/figaro for a copy of the software license.
*/
-
Package Statement format
package com.cra.figaro.XXX
-
Import Statements
import java.lang.IllegalArgumentException
-
ScalaDoc Description
/**
- Evidence that can be associated with an element.
*/
- Constructor(s)
Each constructor should have a ScalaDoc header describing the purpose, parameters (if any), and return value (if any).
- 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.
- 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.
-
Import Statement Conventions
a) Always use underscore,
b) Rename to resolve name conflicts,
c) Always use fully qualified package names