[cfe-dev] Can clang-format require braces for if, else, while, for, and do?

David Blaikie dblaikie at gmail.com
Fri May 16 09:02:46 PDT 2014


clang-format doesn't do textual insertions/removals, only whitespace
formatting (except in some particular cases, like comment line
wrapping)

Features like this will go into the clang-tidy tool.

On Fri, May 16, 2014 at 8:50 AM, Hal Canary <halcanary at google.com> wrote:
> Is there a way for clang-format to convert code in the form:
>
>     if (a)
>         return 0;
>     if (b) return 0;
>
> into this:
>
>     if (a) {
>         return 0;
>     }
>     if (b) { return 0; }
>
> If not, how should I request this feature?
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list