doc/coding_standards_js.rst
author Alexandre Fayolle <alexandre.fayolle@logilab.fr>
Tue, 22 Mar 2011 15:11:38 +0100
branchstable
changeset 7108 bcdf22734059
parent 6049 f0ae98fa85a1
permissions -rw-r--r--
Abstract the support for ORDER BY and LIMIT/OFFSET SQL generation all DB engines do not support the same syntax for these features, MS SQLServer being the bad boy we try to support in CW. * Use two new methods of dbhelper to add LIMIT/OFFSET clauses and ORDER BY clauses * added unit tests for sqlserver backend * changed unittest_rql2sql to lauch the backend tests even if the driver module is not installed on the machine, so that we can run the sqlserver tests on linux (and the mysql tests too) * adapt msstep.py to the new interface closes #1154756

Javascript Coding Standards
---------------------------

(Draft, to be continued)

:Naming: camelCase, except for CONSTANTS

Indentation rules
~~~~~~~~~~~~~~~~~
- espace avant accolade ouvrante

- retour à la ligne après accolade ouvrante (éventuellement pas
  de retour à la ligne s'il y a tout sur la même ligne, mais ce n'est
  pas le cas ici.

- no tabs


Documentation
~~~~~~~~~~~~~
XXX explain comment format for documentation generation


Coding
~~~~~~
- Don't forget 'var' before variable definition, and semi-colon (';') after **each** statement.
- Check the firebug console for deprecation warnings


API usage
~~~~~~~~~
- unless intended, use jQuery('container') rather than jqNode('container')


See also
~~~~~~~~
http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml