Skip to content
Eirik Csák Knutsen edited this page Dec 2, 2015 · 10 revisions

Contribution guidelines

  • Use four spaces for indentation - NO tabulators
  • Leave empty line at end of every file
  • For new independent features, create a new branch named feature/[name of feature]
  • For bug fixes, create new branch named bugfix/[name of feature]
  • Use pull requests when you wish to merge your work - NO commits directly to master or dev

Coding style

s4a.js follows Google's JavaScript Style Guide, with some exceptions:

  • checkAnnotations: Added extra params file, overview, fileoverview, private, abstract and readonly
  • disallowMultipleVarDecl: Allow declarations where all variables are not defined
  • maximumLineLength: 110
  • validateIndentation: 4 spaces

We are using jshint to check the code for any bugs or errors and jscs to enforce the coding style. The style guides are stored in two files on the root folder, .jshintrc (used by jshint) and google.json (used by jscs). Jscs is configured to autofix code style violations when possible.

Building the code are done using grunt and all the project configuration are stored in gruntfile.js on the project root folder.

To build the entire project simply write

grunt

To check for any bugs write

grunt jshint:dev

To check for styling errors write

grunt jscs

How to setup build environment

  • Install latest version of Node
  • Install grunt client: npm install -g grunt-cli
  • Install jslint npm -a install --save jslint
  • Install closurecompiler npm -g install closurecompiler
Clone this wiki locally