Bug 27496 - Feature request: cpplint should check for indentation - rule 6
Summary: Feature request: cpplint should check for indentation - rule 6
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-21 07:11 PDT by Luciano Wolf
Modified: 2009-07-22 08:17 PDT (History)
4 users (show)

See Also:


Attachments
Add checks for multi-line boolean operator placement (5.05 KB, patch)
2009-07-21 14:09 PDT, Jakob Petsovits
levin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Luciano Wolf 2009-07-21 07:11:52 PDT
According to Indentation rule 6 of the Webkit coding style guidelines[1]:
"Boolean expressions at the same nesting level that span multiple lines should have their operators on the left side of the line instead of the right side."

This isn't currently tested by the cpplint.

[1]
http://webkit.org/coding/coding-style.html
Comment 1 Jakob Petsovits 2009-07-21 13:01:46 PDT
Hm... I wonder if there are any cases where "||" and "&&" are allowed at the end of the line? Otherwise, this would be ridiculously easy.
Comment 2 David Levin 2009-07-21 13:05:26 PDT
>  I wonder if there are any cases where "||" and "&&" are allowed at the end of the line? 

No.
Comment 3 Jakob Petsovits 2009-07-21 14:09:24 PDT
Created attachment 33213 [details]
Add checks for multi-line boolean operator placement

...like this? Seems the new check caught an issue in cpplint_unittest.py itself :P
Comment 4 David Levin 2009-07-21 14:41:35 PDT
> Seems the new check caught an issue in cpplint_unittest.py itself

Yeah, this tool was originally developed for Google style which doesn't have this rule, so as it gets closer to WebKit style, differences in WebKit and Google style are exposed (which is all good).
Comment 5 Adam Treat 2009-07-22 08:17:31 PDT
Landed with r46224.