-
Notifications
You must be signed in to change notification settings - Fork 24
Coding Style
-
Follow, as much as possible, the guidlines in Programming Guidelines on Haskell Wiki. As much as possible the code should compile and haddock with out warnings. Also use tools like hlint and stylish-haskell
-
By default emacs uses the GNU style of indentation for C code. I (piyush-kurur) really cannot stand this style. Please use the linux kernel style. Here is the relevant portion of my
.emacs
;; C coding style ;; (setq c-default-style "linux" c-basic-offset 4)
For vim users set the following in the
vimrc
set tabstop=4 shiftwidth=4 expandtab
-
Make sure that there are no trailing blanks at the end of lines and string of newlines at the end of the file. An easy way to ensure this is to enable the git hook called pre-commit. If you are in the root directory of the repository, the following command will do the trick. For more information see http://git-scm.com/book/en/Customizing-Git-Git-Hooks
mv .git/hooks/pre-commit.sample .git/hooks/pre-commit
-
Make sure that all lines end with
\n
instead of\r\n
. In case you are using windows, please consider settingcore.autocrlf
true. The suggested settings for a windows user aregit config core.autocrlf true git config core.safecrlf warn