[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: astyle configuration

From: Gene Harvey
Subject: Re: astyle configuration
Date: Tue, 14 Jan 2020 08:15:10 -0600

I've attached the configuration I was using.

Observations based on using it on a random file:
- It's worse than I remember.
- Almost every file would have a diff because the space after the
`defined` macro would be removed.
- DerivePointerAlignment applies either left or right-alignment to
both * and &, rather than independently.
- Matrix indexing function calls, where there isn't a space before the
parenthesis, would become uniform with the usual function calls.
- Binary operators would have spaces surrounding them.
- clang-format prefers to place = on a new line before doing any other wrapping.

So, basically the whole style would change. However, the obvious
benefit is that we save brain cells instead of trying to perfectly
format everything manually.


On Mon, Jan 13, 2020 at 11:26 PM John W. Eaton <address@hidden> wrote:
> On 1/13/20 11:15 PM, Kai Torben Ohlhus wrote:
> > I think we should in general change to this layout in such cases:
> >
> >    octave_value retval = (! some_variable.isempty ())
> >                          ? true
> >                          : false;
> >
> > Then astyle also does not break anything with your configuration and for
> > me it is even more clearer, where to look for the condition?true:false
> > parts of that operator.
> If you write it like this
>    octave_value retval = (! some_variable.is_empty ()
>                           ? do_something (with, some, arguments)
>                           : do_something_else (with, other, arguments));
> then Emacs CC mode will do the right thing with indenting the ?: to line
> up inside the outer parens.
> jwe

Attachment: .clang-format
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]