WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
58792
check-webkit-style should warn about { being on the same line as an if
https://bugs.webkit.org/show_bug.cgi?id=58792
Summary
check-webkit-style should warn about { being on the same line as an if
Eric Seidel (no email)
Reported
2011-04-18 09:16:11 PDT
check-webkit-style should warn about { being on the same line as an if if (foo) { } Should get a warning. Likewise: if (foo || bar) { } The latter was found a bunch in:
https://bugs.webkit.org/show_bug.cgi?id=57885#c32
but the style elf failed to warn us. :(
Attachments
Add attachment
proposed patch, testcase, etc.
David Levin
Comment 1
2011-04-18 09:21:00 PDT
I usually like to advice the offender to consider submitting a patch. (It scales better that way :).) I'm guessing that is cdn in this case. Cris, I'd be happy to give you pointers if you're interested. PS The code is here:
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
Eric Seidel (no email)
Comment 2
2011-04-18 09:36:48 PDT
Just making sure we have the bug on file. I wasn't requesting anyone fix. :) But i agree, I'm also happy to walk Cris through the python if he's interested in making sure this never bites anyone else again.
Cris Neckar
Comment 3
2011-04-20 18:08:54 PDT
Sure I can take a crack at this tomorrow. should we do the same for function blocks, and loops?
David Levin
Comment 4
2011-04-20 19:06:12 PDT
(In reply to
comment #3
)
> Sure I can take a crack at this tomorrow. should we do the same for function blocks, and loops?
Everything except functions. (Not sure I think it may warn already about classes.) WebKit style is to put the { at the end of line except for the opening brace for function/methods. (We have a style error for the function/method case).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug