# pcb-rnd - indentation

As of r1022 all old code is converted using indent(1). Our preferred coding style is close to what the following command line produces, using our patched version of indent(1):

    indent --line-length256 -brs -br -nce --tab-size2 -ut -npsl  -npcs -hnl -cli2 -nsaf -sai -nsaw -ncs -c0 -cd0 -cp0

Contributors are kindly asked to follow this style or run the above commandline on their new code before sending a patch or committing to svn. The style of existing code lines should not be changed, not even the "surrounding" lines to a largish patch, especially not in the same patch/commit with actual code changes.

We do not put space between the pointer-asterisk and name; indent(1) unfortunately does this in function declaration:

right | wrong
--- | ---
`int foo(char *bar);` | `int foo(char * bar);`

We have a patch against indent 2.2.11 to fix this.

We do not use tabs for aligning code in columns; we use tabs exclusively to indicate levels logical alignment. indent(1) attempts to align the right-side comments using tabs. We have a patch against indent 2.2.11 to change this when column is set to 0.