← Back to team overview

kicad-developers team mailing list archive

Re: clang-format seems to be breaking the rules?

 

On Wed, Mar 20, 2019 at 7:30 PM Wayne Stambaugh <stambaughw@xxxxxxxxx> wrote:
>
> The moral of the story is "never trust the auto-formatter".  Sounds
> suspiciously like "never trust the auto-router" :)

The good news is that you can defeat Skynet with some well-crafted C++
formatting. The bad news is self-driving cars probably use Clang
somewhere....

I have "git clang-format --diff" aliased "g cfd" for a reason!
However, 95% of the time it goes off, it's right, and I've missed
something. Blindly auto-formatting is a bad idea, but having the hook
on is very helpful to me.

Note: the hook will never change your code, it'll only warn you. It's
up to you to run "git clang-format" and then "git add" what it did to
the git staging area.

I will commit the exclusions to the checks soon, manually skipping
wxFB files is very tedious!

Cheers,

John


References