[GRASS5] Color prompt partially implemented, color confusion.

Hamish hamish_nospam at yahoo.com
Thu Apr 20 01:13:53 EDT 2006

> One note about source code: tab stops are every 8 columns. If your
> editor is set to use something else, you need to change it when
> editing GRASS source code, otherwise the formatting will get screwed
> up.
> The indentation width is a different matter. There isn't (yet) an
> agreed standard; for existing files, you should follow whichever
> convention(s) the source file is already using.

This has been added to the SUBMITTING file not long ago:

14. To promote a consistent coding style, please use the "indent" program
    on all new C modules using the following switches:
     $ indent -nbad -bap -bbb -nbbo -nbc -br -bli1 -bls -cbi0 -ncdb -nce \
        -ci4 -cli0 -ncs -d0 -di0 -fc1 -nfca -hnl -i4 -ip4 -l80 -lc80 -lp \
	-npcs -pi4 -nprs -npsl -sbi0 -sc -nsob -ss -ts8  main.c

    Existing code should not be re-indented except in extreme cases, as this
    will make "diff" comparisons with older versions impossible. If indent is 
    needed, do not check in any changes other than the indentation in the same 
    commit! Do add the indent switches and any indent warning messages to the 
    CVS log. Any change or fix mixed in with an indent is very hard to track 
    making it hard for others to follow the change or fix any new bugs.


Suggested indent level is 4 spaces, 8 spaces become a tab.

The idea is not to be strict about it but for the code to be readable 
and (somewhat) consistent in style.


More information about the grass-dev mailing list