[llvm-dev] Doubts regarding clang-format

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 18 10:51:19 PDT 2021


Generally the goal of clang-format is to only modify whitespace (I think
sorting includes is one place where that goal is intentionally violated, so
it's not a completely hard rule. -though includes may be easier to identify
with certainty and modify with some certainty it shouldn't affect the
result), so (1) would be out of scope for clang-format, and appropriately
implemented in clang-tidy as you've seen.

Can't say I know much about (2) - seems like it could be implemented, but
probably not something anyone's tried to do, I would've thought - so I
doubt there's much infrastructure for it.

On Sun, Apr 18, 2021 at 10:44 AM saloni goyal via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

>   Hello!
>
> I am working on a clang format. I want to customize it:
>
> 1. For if-else condition I want that for one line statement written in
> multiple lines should get wrapped in braces and also if there are only
> nested if-else then that code should be wrapped in braces. I have seen
> clang-tidy and in
> that google-readability-braces-around-statements.ShortStatementLines with
> value 2 gives expected results to me but I want that it should be done with
> clang-format.
>
> 2. For some comments the indent level should be more or the clang-format
> should accept some comment intend level as it.
>
> I want to make these changes in my clang-format. Please can you suggest
> some way to get these results?
>
> Regards
> Saloni
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210418/fc267bda/attachment.html>


More information about the llvm-dev mailing list