changeset 1509:189ffdd944b4

Add a small Coding Style document
author Mikael Berthe <mikael@lilotux.net>
date Sun, 31 Aug 2008 15:21:49 +0200
parents 86620c83123b
children 6d36a36a01c6
files mcabber/CodingStyle.txt
diffstat 1 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mcabber/CodingStyle.txt	Sun Aug 31 15:21:49 2008 +0200
@@ -0,0 +1,33 @@
+This document describes the preferred coding style for the mcabber project.
+
+If you intend to patch and contribute to mcabber, please try to use the
+existing style, and read the following points.
+
+- Do not use tabs, use space characters;
+- Avoid trailing whitespace;
+- Avoid lines longer than 80 characters;
+- Indentation is 2 spaces (ok, maybe it isn't a good idea but it's the
+  current style);
+- Put a space after non-functions statements (e.g. if, while...)
+- Put the opening brace last on the same line, and put the closing brace first
+  except for functions, where the opening brace should be alone on a new line.
+
+  Example:
+
+    void example(void)
+    {
+      if (cond1) {
+        do_a();
+      } else if (cond2) {
+        do_b();
+      } else {
+        do_c();
+      }
+
+      if (error)
+        exit(0);
+    }
+
+ - Look at existing code for rules not mentioned here.
+
+Mikael