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 / TestsAssignee: 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)
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
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.