curl-library
Re: CODE_STYLE
Date: Mon, 14 Mar 2016 09:53:04 +0000
On 14 Mar 2016, at 09:45, Daniel Stenberg <daniel_at_haxx.se> wrote:
> It was about time that we expanded our documentation on what C code style we use in this project so I've just created 'docs/CODE_STYLE.md'. See https://github.com/curl/curl/blob/master/docs/CODE_STYLE.md
My favourite additions to this would be:
a) a set of editor settings for the coding style used for vi / emacs / whatever
b) a set of parameters for the 'indent' command that makes everything look right (my recollection - long time since I hacked on curl source - it's gnu indent style, in which case the set of parameters is 'none')
c) a style checker (as qemu for instance has)
One of the things I learnt a long while ago is that if you have a tool to correct formatting, you can avoid any incorrect formatting by refusing commits (or even builds) which are not formatted correctly (i.e. which this tool changes). I do that at $work with 'indent'. qemu folks do it automatically with patch submission. lots of go projects do this with the very useful 'go fmt'.
-- Alex Bligh ------------------------------------------------------------------- List admin: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2016-03-14