[cfe-dev] [clang-tidy] readability-else-after-return
Daniel Jasper via cfe-dev
cfe-dev at lists.llvm.org
Tue Dec 8 14:15:32 PST 2015
Yes, we are aware. The check was implemented mostly for a clang-tidy
tutorial. It could certainly use more love.
As for the clang-format issue, I have recently updated clang-format to
support this case better in general (just removing or adding braces). Not
sure whether clang-format-diff.py can make use of this yet.
On Tue, Dec 8, 2015 at 7:55 PM, Piotr Padlewski <piotr.padlewski at gmail.com>
> Hi folks,
> so recently I was testing clang-tidy, and I had a problem with the check
> 1. running git-clang-format after applying transformation doesn't format
> everything, because this check only removes one line (+ braces), which
> doesn't affect other lines, which leeds to wrong identation.
> 2. It only transform one else at one time so for example for code like
> if (multilevel && isMultilevelPolicyDescendable(policy, getDepth()))
> return ..
> else if (size() > 1) // it was only able to remove this one
> return ...
> if (policy.type == ClassificationType::EXTRA_PARAMS)
> Did you know about those problems? I was talking with Nick (cc) and he was
> surprised that not all formatting can be done by just applying
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev