New issue
Advanced search Search tips

Issue 655018 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Oct 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Resolve multi-line conditional difference between check-webkit-style and git cl format

Project Member Reported by pdr@chromium.org, Oct 12 2016

Issue description

git cl format will format will make the following change:
if (blah)
  return foo->bar->baz();

to

if (blah)
  return foo->
      bar->
      baz();

Unfortunately we have a rule in check-webkit-style that disallows this:
** Presubmit ERRORS **
check-webkit-style failed
  ...  A conditional or loop body must use braces if the statement is more than one line long.  [whitespace/braces] [4]


Nico and Daniel, would you be okay with me turning off this check-webkit-style rule?
 

Comment 1 by dcheng@chromium.org, Oct 12 2016

I'm OK with it. FWIW, this has always been the case, it's just clang-format tickles this case more.

I'd like to make clang-format do this automatically, but it's non-trivial as it turns out: https://llvm.org/bugs/show_bug.cgi?id=26215

Comment 2 by thakis@chromium.org, Oct 12 2016

Can't you just add braces when this happens? Is this very common?

(But turning it off is fine with me too)

Comment 3 by pdr@chromium.org, Oct 12 2016

Status: WontFix (was: Assigned)
Thanks for the info. I misunderstood and thought "git cl format" was doing the right thing here, and check-webkit-style was just out-of-date.

Now that I see that the style guide does want braces, leaving this presubmit check on and fixing https://llvm.org/bugs/show_bug.cgi?id=26215 (eventually) seems like a better fix.

Sign in to add a comment