Mailing List Archive

code formatting
When modifying dbmail I'm having trouble sticking to your code
formatting conventions. What are they exactly? They seem like the GNU
coding standards, except that there aren't spaces before parenthesis,
that lines don't wrap at 80 columns, and function names don't start on a
separate line.

What options should I give to vim and/or GNU indent to format my code
properly?

--
Jonas Jensen <jbj@knef.dk>
Re: code formatting [ In reply to ]
Most of the code uses a fairly bizarre pattern, but I'm quite fond of it
because I really don't like The One True Nasty Looking Pattern (TM).

int function( arguments )
{
code;
code;
if( something )
{
code;
code;
}
else
{
code;
code;
}
return val;
}

Note that there isn't much consistency for parentheses, though. I happen
to like leaving space around my arguments and not between the function and
the left parenthesis, but I'd say it's 50/50 in the codebase right now.

To get vim to stop putting in tabs, :set expandtab. If you have tabbed
code, you can use :set tabstop=2, :set expandtab, :retab 2 to mostly fix
it. Unfortunately, I'm not sure yet how to handle the extra offset between
the curly braces and their code blocks, so I've been doing it manually.

Aaron


On 19 Apr 2003, Jonas Jensen wrote:

> When modifying dbmail I'm having trouble sticking to your code
> formatting conventions. What are they exactly? They seem like the GNU
> coding standards, except that there aren't spaces before parenthesis,
> that lines don't wrap at 80 columns, and function names don't start on a
> separate line.
>
> What options should I give to vim and/or GNU indent to format my code
> properly?
>
> --
> Jonas Jensen <jbj@knef.dk>
>
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>
Re: code formatting [ In reply to ]
ah well hmm..

that's mainly because eelco and i use different formatting. Moreover i
am not always as consistent as i should be in my own formatting habit :$

as long as the code is readable i don't mind having mixed styles in the
dbmail source - i regard upon it as a side effect of open source
development ;-)

roel


Aaron Stone heeft op zondag, 20 apr 2003 om 00:23 (Europe/Amsterdam)
het volgende geschreven:

> Most of the code uses a fairly bizarre pattern, but I'm quite fond of
> it
> because I really don't like The One True Nasty Looking Pattern (TM).
>
> int function( arguments )
> {
> code;
> code;
> if( something )
> {
> code;
> code;
> }
> else
> {
> code;
> code;
> }
> return val;
> }
>
> Note that there isn't much consistency for parentheses, though. I
> happen
> to like leaving space around my arguments and not between the function
> and
> the left parenthesis, but I'd say it's 50/50 in the codebase right now.
>
> To get vim to stop putting in tabs, :set expandtab. If you have tabbed
> code, you can use :set tabstop=2, :set expandtab, :retab 2 to mostly
> fix
> it. Unfortunately, I'm not sure yet how to handle the extra offset
> between
> the curly braces and their code blocks, so I've been doing it manually.
>
> Aaron
>
>
> On 19 Apr 2003, Jonas Jensen wrote:
>
>> When modifying dbmail I'm having trouble sticking to your code
>> formatting conventions. What are they exactly? They seem like the GNU
>> coding standards, except that there aren't spaces before parenthesis,
>> that lines don't wrap at 80 columns, and function names don't start
>> on a
>> separate line.
>>
>> What options should I give to vim and/or GNU indent to format my code
>> properly?
>>
>> --
>> Jonas Jensen <jbj@knef.dk>
>>
>> _______________________________________________
>> Dbmail-dev mailing list
>> Dbmail-dev@dbmail.org
>> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>>
>
> _______________________________________________
> Dbmail-dev mailing list
> Dbmail-dev@dbmail.org
> http://twister.fastxs.net/mailman/listinfo/dbmail-dev
>

_________________________
R.A. Rozendaal
ICT Manager
IC&S
T: +31 30 2322878
F: +31 30 2322305
www.ic-s.nl