On Tue, Sep 26, 2017 at 02:49:56PM +0200, Sylvestre Ledru wrote:
> Le 26/09/2017 à 14:33, smaug a écrit :
> > On 05/23/2014 04:29 AM, Anthony Jones wrote:
> >> Some of you may remember the discussion on clang-format and the `mach
> >> clang-format` command. What we have in place right now is very temporary
> >> but it is functional enough to give it a try. I have not put the effort
> >> into upstreaming my changes. Depending on the feedback I receive I will
> >> either:
> >>
> >> * Finish my existing changes and upstream them
> >> * Remove the `mach clang-format` command altogether
> >> * Do nothing
> >>
> >> I have personally found it useful. However I would like to hear from
> >> other people who have tried it to help me decide what to do next.
> >>
> >> Anthony
> >>
> >
> >
> > clang-format messes up really badly many macros.
> > For example nsElementTable.cpp becomes unreadable.
>
> Yeah, for this kind of structure & presentation layout, we should just ignore
> the formatting on these.
>
> It is hard for reformatting tools to know exactly to do with such patterns.
>
> I reported bug 1403150 for this.
Having run clang-format on a few files recently, I must say I don't like
that it insists some things mut be on one line. Essentially, when you
have a method that is short enough to fit in one line, it forces it to.
And then you end up with something like:
class Foo {
Type MethodA() { do_something(); }
Type MethodB()
{
do_something_that_happens_to_be_long_enough_not_to_fit_on_the_same_line();
}
Type MethodC() { do_something_else(); }
};
And I find that distracting. Is there a pref to make it not reformat things
that look reasonable already, although not "optimally" so?
Mike
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform