source: branches/samba-3.3.x/README.Coding@ 1075

Last change on this file since 1075 was 206, checked in by Herwig Bauernfeind, 17 years ago

Import Samba 3.3 branch at 3.0.0 level (psmedley's port)

File size: 6.3 KB
Line 
1##
2## Coding conventions in the Samba 3 tree
3##
4
5===========
6Quick Start
7===========
8
9Coding style guidelines are about reducing the number of unnecessary
10reformatting patches and making things easier for developers to work together.
11You don't have to like them or even agree with them, but once put in place
12we all have to abide by them (or vote to change them). However, coding
13style should never outweigh coding itself and so the the guidelines
14described here are hopefully easy enough to follow as they are very
15common and supported by tools and editors.
16
17The basic style, also mentioned in the SAMBA_4_0/prog_guide.txt is the
18Linux kernel coding style (See Documentation/CodingStyle in the kernel
19source tree). The closely matches what most Samba developers use already
20anyways.
21
22But to save you the trouble of reading the Linux kernel style guide, here
23are the highlights.
24
25
26* Maximum Line Width is 80 Characters
27 The reason is not for people with low-res screens but rather sticking
28 to 80 columns prevents you from easily nesting more than one level of
29 if statements or other code blocks. Use source/script/count_80_col.pl
30 to check your changes.
31
32* Use 8 Space Tabs to Indent
33 No whitespace filler.
34
35* No Trailing Whitespace
36 Use source/script/strip_trail_ws.pl to clean you files before committing.
37
38* Follow the K&R guidelines. We won't go throw them all here. You have
39 a copy of "The C Programming Language" anyways right? You can also use
40 the format_indent.sh script found in source/script/ if all else fails.
41
42
43
44============
45Editor Hints
46============
47
48Emacs
49-----
50Add the follow to your $HOME/.emacs file:
51