Great.

Well there are some astyle options
(http://astyle.sourceforge.net/astyle.html#_Padding_Options) for
configuring this kind of padding, also:

 --break-closing-brackets  OR  -y
 Break brackets before closing headers (e.g. 'else', 'catch', ...).
 Use with --brackets=attach, --brackets=linux,
 or --brackets=stroustrup.

 --break-elseifs  OR  -e
 Break 'else if()' statements into two different lines.

 --add-brackets  OR  -j
 Add brackets to unbracketed one line conditional statements.

 --add-one-line-brackets  OR  -J
 Add one line brackets to unbracketed one line conditional
 statements.

 --keep-one-line-blocks  OR  -O
 Don't break blocks residing completely on one line.

 --keep-one-line-statements  OR  -o
 Don't break lines containing multiple statements into
 multiple single-statement lines.

On Mon, Nov 21, 2011 at 9:25 PM, Jörn Kottmann <[email protected]> wrote:
> On 11/21/11 10:59 AM, Alec Taylor wrote:
>>
>> Can't you configure every IDE to notice if the if statement is not
>> within braces?
>>
>> (you can also configure emacs and vim to notice)
>
>
> Didn't see that option in eclipse, but I wouldn't use it anyway,
> since it will then output tons of warnings for existing code and
> I don't think that this violation would be a reason to change our
> existing code.
>
>> I find that if your coder can't even notice when his conditional or
>> loop is greater than 2 lines and thus requires braces, then that coder
>> isn't any good.
>
>
> If someone new starts to write or change our code they usually try
> to imitate our existing coding style. The code conventions page should
> be a help to make this easier.
>
> The people which belong the group above will always produce code which
> is readable and can be committed in the format it is anyway.
> I personally don't want to strictly enforce code conventions on code which
> has a good readability and mostly complies with the code conventions.
>
> Jörn
>
>

Reply via email to