git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Document conding style
@ 2008-02-27  8:13 Martin Koegler
  2008-02-27  8:36 ` David Symonds
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Martin Koegler @ 2008-02-27  8:13 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Martin Koegler

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
---
Documentation/CodingGuidelines |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 3b042db..e1b5d78 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -77,6 +77,30 @@ For C programs:
    of "else if" statements, it can make sense to add braces to
    single line blocks.
 
+ - Avoid trailing whitespaces
+
+ - Pointer to struct foo type is (struct foo *), not (struct foo*)
+
+ - One space each around comparison operator "=="
+
+ - One space around assignment operator "="
+
+ - One space after "if", "while", "switch" and friends before "("
+
+ - No space between function name and "("
+
+ - A function without parameter is "static void foo(void)", not
+   "static void foo()"
+
+ - Don't do any declaration after a statement.
+
+ - Multi-line comment is:
+
+        /*
+         * This is multi line comment
+         * and this is its second line.
+         */
+
  - Try to make your code understandable.  You may put comments
    in, but comments invariably tend to stale out when the code
    they were describing changes.  Often splitting a function
@@ -105,6 +129,9 @@ For C programs:
    changed and discussed.  Many git commands started out like
    that, and a few are still scripts.
 
+ - Consider checking your patches with checkpatch from the linux 
+   kernel. It helps you to spot trivial formating errors.
+
  - Avoid introducing a new dependency into git. This means you
    usually should stay away from scripting languages not already
    used in the git core command set (unless your command is clearly
-- 
1.5.4.3.ga3d8

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-28 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-27  8:13 [PATCH] Document conding style Martin Koegler
2008-02-27  8:36 ` David Symonds
2008-02-27  9:43 ` Johannes Schindelin
2008-02-28 13:07 ` Jean-Luc Herren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).