Bug 483739 - Establish style guidelines for storage
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Fri, 20 Mar 2009 16:28:16 -0400
changeset 26420 3407ca1084a6fd02419d28227eb6138ce935e2ce
parent 26419 1effb72d30cf6b7701485e450b87bddcb7e9891d
child 26421 a809eae393418f7051156f6c8fb33e9bbf81a1e6
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
Bug 483739 - Establish style guidelines for storage This adds style.txt to storage/ that indicates how new code should be styled. Reviewers are expected to enforce this! r=asuth
new file mode 100644
--- /dev/null
+++ b/storage/style.txt
@@ -0,0 +1,42 @@
+Storage Module Style Guidelines
+These guidelines should be followed for all new code in this module.  Reviewers
+will be enforcing them, so please obey them!
+* All code should be contained within the namespace Mozilla::Storage at a
+  minimum.  The use of namespaces is strongly encouraged.
+* The indentation level to use in source code is two spaces.  No tabs, please!
+* All files should have the following emacs and vim mode lines:
+  -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+  vim: sw=2 ts=2 sts=2 et :
+* All functions that are not XPCOM should start with a lowercase letter.
+* Function arguments that are not out parameters should be prefixed with a (for
+  pArameter), and use CamelCase.
+* Function arguments that are out parameters should be prefixed with an
+  underscore and have a descriptive name.
+* Function declarations should include javadoc style comments.
+* For function implementations, each argument should be on its own line.
+* All variables should use camelCase.
+* The use of bool is encouraged whenever the variable does not have the
+  potential to go through xpconnect.
+* For pointer variable types, include a space after the type before the asterisk
+  and no space between the asterisk and variable name.
+* If any part of an if-else block requires braces, all blocks need braces.
+* Every else should be on a newline after a brace.
+* Bracing should start on the line after a function and class definition.
+* If a return value is not going to be checked, the return value should be
+  explicitly casted to void (C style cast).