Re: automated coding style tool

Luis Machado via Gdb
2025-01-20T11:31:53Z

On 1/18/25 18:56, Tom Tromey wrote:
>>>>>> "Luis" == Luis Machado <luis.machado@arm.com> writes:
>
>>> I'm in favor of using a tool but my view is that it has to meet some
>>> minimal standard of usefulness. I just think clang-format does not do
>>> this.
>
> Luis> That's fair. But are we factoring in the amount of time spent over the years
> Luis> telling contributors "you forgot a space here", "two spaces after period"?
>
> Yes, of course I did.

Sorry, it was more a rhetorical question. I wasn't implying you had not.

>
> I review a lot of patches. My feeling is that formatting is
> occasionally an issue, particularly with newcomers, but not really a big
> part of review. Bad formatting can be a signal that a patch requires
> more attention, because experienced developers try to make their changes
> conform to the style of the surrounding code -- so discrepancies mean
> you may be dealing with someone who isn't so adept.
>
> On the other hand, I also read a lot of code. And, my view overall is
> that readability is far more important than ease of formatting. And,
> furthermore, I dislike some aspects of clang-format's output, on
> readability grounds.

I think readability is important as well. My personal take on it is that formatting
might make less of a difference compared to how the code is actually written.

In particular excessive templating, lambda's, macros and excessive use of auto are things
that tend to bring readability down for me. But they tidy up the code somewhat, so it is
a compromise I guess.

>
> Luis> Some stuff is a bit different and some other stuff is very different. But
> Luis> personally I'm willing to see this automation go through and I'm fine
> Luis> adapting to a potentially new format, whatever that is.
>
> Me too, but within some bounds.
>
> Luis> I might've mentioned this already, but for folks that deal with
> Luis> multiple projects,
>
> FWIW I also deal with multiple projects.

I'm aware of that. I think it came out a bit off, but I wasn't implying
you didn't. Sorry if that sounded like that.

>
> Tom