[PATCH] D95168: Add InsertBraces option

Tiago Macarios via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 21 15:30:48 PST 2021


tiagoma added a comment.

Some background might be useful. I work at Microsoft (Office to be precise). We have our own fork of LLVM internally and I am starting to upstream some of the changes in our fork.

> There's a clang-tidy check for it.

Yes - readability-braces-around-statements. I would argue that clang-tidy is a heavyweight tool for this.

> And clang-format should not, IMO, add not remove tokens but only handle whitespace.

I don't think token operations are novel, see the `InsertTrailingCommas`, `JavaScriptQuotes`, `SortUsingDeclarations`, `FixNamespaceComments` options. Also, keep in mind that this option is fairly self contained (it happens before the `Formatter` pass) and it is off by default.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95168/new/

https://reviews.llvm.org/D95168



More information about the cfe-commits mailing list