Bug 58792
Summary: | check-webkit-style should warn about { being on the same line as an if | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | cdn, levin |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 |
Eric Seidel (no email)
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
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)
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
Sure I can take a crack at this tomorrow. should we do the same for function blocks, and loops?
David Levin
(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).