On 20.06.19 17:26, ron minnich wrote:
> clang-format is not a textual preprocessor. It is basically the ast
> builder of followed by output.
>
> So in your case, I just tried it
> main() {
>
>   if (foo)
>     bar();
>     baz();
> }
>
> and got the right thing, i.e. braces around bar but not baz.
>
> The history of reviewers looking at code is they miss this kind of
> error. Constantly. I'm in favor of as much automation as we can get.

Sorry, I guess I wasn't clear enough, we're talking past each other.
What I meant is that if somebody writes

    if (foo)
            bar();
            baz();

they most probably forgot the _necessary_ braces and clang-format
would hide this intention even from a human reviewer.

Nico
_______________________________________________
coreboot mailing list -- coreboot@coreboot.org
To unsubscribe send an email to coreboot-le...@coreboot.org

Reply via email to