Re: [PATCH] clang-format: Set IndentWrappedFunctionNames false

From: Miguel Ojeda
Date: Thu Jun 07 2018 - 08:57:06 EST


On Wed, Jun 6, 2018 at 10:25 PM, Jason Gunthorpe <jgg@xxxxxxxxxxxx> wrote:
> On Wed, Jun 06, 2018 at 01:18:59PM -0700, Joe Perches wrote:
>> On Wed, 2018-06-06 at 14:15 -0600, Jason Gunthorpe wrote:
>> > The true option causes this indenting for functions:
>> >
>> > static struct something_very_very_long *
>> > function(void *arg)
>> > {
>> >
>> > While a quick survey suggests that the usual Linux fallback is the GNU
>> > style:
>> >
>> > static struct something_very_very_long *
>> > function(void *arg)
>> >
>> []
>> > AFAIK the above describes the more common choice in the code base?
>> >
>> > Not sure who's tree this is supposed to go through.. Andrew I guess?
>>
>> I believe so yes.
>>
>> I expect there will be more refinements to .clang-formata
>> as perhaps more people experiment with it too.
>>
>> Acked-by: Joe Perches <joe@xxxxxxxxxxx>
>
> Thanks Joe,
>
> I saw your note in the original mailing-list thread and just wanted to
> say the way I use clang-format is editor based.
>
> I have a hotkey that triggers clang-format to reformat the current
> statement, or current hi-lighted region. If I don't like it, then
> 'undo' puts it all back for manual adjustment..
>
> This way I am selective of where I apply it, and I find it is
> something like 95% of the time good, IHMO.
>
> Big time saver for wrapping long lines, moving code around (eg
> indent,de-indent) and other mundane daily tasks.

Indeed, I agree that currently this is the best way to use it (until
and if we get full support for the kernel style in clang). In the
documentation I wrote I mentioned this point. It can also be useful
file-wide to quickly spot style issues: apply clang-format - inspect
git diff - reset back.

Cheers,
Miguel

>
> Cheers,
> Jason