[flang-commits] [PATCH] D104100: [flang] Add clang-tidy check for braces around if

Diana Picus via Phabricator via flang-commits flang-commits at lists.llvm.org
Tue Jun 15 01:30:34 PDT 2021


rovka added a comment.

In D104100#2817080 <https://reviews.llvm.org/D104100#2817080>, @klausler wrote:

> In D104100#2816392 <https://reviews.llvm.org/D104100#2816392>, @rovka wrote:
>
>> I disabled the check for Optimizer and Lower. With the newest version of the patch, I'm seeing several violations in lib/Semantics, tools (f18, f18-parse-demo, tco) and 2 rogue ones in the runtime. I'm going to fix the ones from the runtime, but I'm not sure about the others. What's the preferred style for lib/Semantics and tools?
>
> I wouldn't worry about the tools; few if any of those will survive in the llvm tree.  The semantics code uses the stricter style.

Just to clarify, by stricter style you mean *with* braces?

In any case, I'm uploading a new version with all the changes required to make flang clean with respect to this check - no braces in Lower, Optimizer and tools, braces everywhere else.



================
Comment at: flang/include/flang/Lower/.clang-tidy:1
-Checks: 'readability-identifier-naming,llvm-include-order,clang-diagnostic-*'
+Checks: '-readability-braces-around-statements,readability-identifier-naming,llvm-include-order,clang-diagnostic-*'
 InheritParentConfig: true
----------------
schweitz wrote:
> Are this explicit removals really required? clang-tidy is supposed to use the .clang-tidy from the nearest parent and InheritParentConfig is not set.
Actually InheritParentConfig is set to true in all of these, so we do need to explicitly remove them.


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

https://reviews.llvm.org/D104100



More information about the flang-commits mailing list