Bug 27497 - Feature request: cpplint should check for braces - rule 2
Summary: Feature request: cpplint should check for braces - rule 2
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:26 PDT by Luciano Wolf
Modified: 2009-07-21 12:56 PDT (History)
2 users (show)

See Also:


Attachments
Add support for making sure { is on the same line as foreach (3.10 KB, patch)
2009-07-21 12:31 PDT, Kenneth Rohde Christiansen
manyoso: 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:26:45 PDT
According to Braces rule 2 of the Webkit coding style guidelines[1]:
"Other braces: place the open brace on the line preceding the code block; place the close brace on its own line."

cpplint doesn't complain about non-compliance with this rule when using the Qt foreach macro, as illustrated below

WRONG CODING STYLE: 

    foreach (AbstractMetaFunction *func, lst)
    {
        qDebug() << "*" << func->ownerClass()->name()
                        << "Private: " << func->isPrivate()
                        << "Empty: " << func->isEmptyFunction();
    }

[1]
http://webkit.org/coding/coding-style.html
Comment 1 Kenneth Rohde Christiansen 2009-07-21 12:31:22 PDT
Created attachment 33199 [details]
Add support for making sure { is on the same line as foreach
Comment 2 Kenneth Rohde Christiansen 2009-07-21 12:43:57 PDT
Landed in r46188