Skip to content

SickRage Coding Standards

Labrys of Knossos edited this page Feb 16, 2016 · 2 revisions

CODING STANDARDS

Prior to approving a PR all the following standards must be adhered to.
Any exceptions must be documented in comments.
Existing code is not a reason to diverge from these standards.

PYTHON

Unless otherwise stated follow the Google Python Style Guide

Strings
  • Use triple-double-quoted doc strings
  • Use single quoted strings. Double quoted strings may be used to avoid escaping a single-quote in the string.
  • Use .format() instead of % formatting. Prefer named arguments.

HTML

  • Use tags and elements appropriate for an HTML5 doctype (e.g. self-closing tags).
  • Use WAI-ARIA attributes in documentation examples to promote accessibility.
  • DO NOT user any CDNs for any Javascript, CSS or font files.

JS

  • All non library files should pass full lint tests using JSHint and the .jshintrc file in the .build directory. We suggest using atom.io's js linter or something similar to lint on the fly.
  • Use bower components for third-party Javascript when possible, if there's no bower package then it must go in the lib directory.
  • If the Javascript is not a library then it must be placed in the core.js and then be minified using Grunt as listed below.
  • 4 spaces (no tabs)
  • Code should be readable since it all gets minified before shipping.
  • Make sure to run cd .build && npm install && bower install && grunt before commiting any javascript to the repo.

Clone this wiki locally