forked from fuzzmz/sickrage.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
SickRage Coding Standards
Labrys of Knossos edited this page Feb 16, 2016
·
2 revisions
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.
Unless otherwise stated follow the Google Python Style Guide
- 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.
- 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.
- 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
libdirectory. - 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 && gruntbefore commiting any javascript to the repo.