Samba source style guide (was Re: regcreateval "(default)"?)
Luke Kenneth Casson Leighton
lkcl at samba.org
Thu May 25 01:30:40 GMT 2000
On Wed, 24 May 2000, Peter Samuelson wrote:
>
> Luke, hacking in your tree (which I hope to start doing more of as I
> learn my way around and find things I can actually understand well
> enough to hack on), do you have any sort of style guide? The GNU
> Project has one, the Linux kernel has one.... Do you have prefs?
YES! see source/.indent.pro, it's not perfect, but a pretty close fit.
1) always use a tab to indent, not spaces.
2) always use { and } even on single statements.
3) { and } always align like this, on everything (including switch and
even case).
if (...)
{
statement(s);
}
4) limit of 80 chars per line.
5) if the number of indentations (when viewed with tab-as-eight-spaces)
forces you to start wrapping functions messily at the right hand side of
the screen, split the damn function!
that's pretty much it.
More information about the samba-ntdom
mailing list