File: README-DEVELOPMENT-POLICY

package info (click to toggle)
ldm 2%3A2.18.06-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,248 kB
  • sloc: ansic: 4,599; sh: 266; python: 260; makefile: 109; sed: 16
file content (28 lines) | stat: -rw-r--r-- 1,327 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
After a quick discussion on coding styles, here's what we've currently got
for consensus:

For shell scripts:

 - Shell scripts should be fully posix compliant.
 - We will favour the use of if [ ]; then else fi, over && and ||, for clarity
 - When using a multi check if, exception will be using the
   if [ .. ] && [ .. ] || [ .. ] form, as opposed to [ .. -a .. -o .. ] form.
 - If a single line test is used, use test <conditional> &&/|| result, and only
   for tests that fit on a single line.
 - We'll use spaces instead of tabs, and the indentation level will be 4
   spaces, the same as python.

For C programs:
 - Programs should be passed through the "indent" program periodically to clean
   them up.
 - The following indent command line should be used:
   indent -kr -i4 -nut -c50 -psl
     - K&R style (Scott's a greybeard)
     - 4 character tab width, and spaces instead of tabs
     - Align inline comments on column 50
     - A newline after function definitions
 - If you change whitespace or formatting of existing code, please do this in a
   separate merge proposal. This includes running the above indent command on 
   existing code.
 - All if() else blocks will have {}'s, even if only 1 line long, or Ollie will break your thumbs.
 - Comments will be /* */ or Scott will break the rest of your fingers.