[Webkit-unassigned] [Bug 27498] New: Feature request: cpplint should check for braces - rule 3

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 21 07:30:52 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=27498

           Summary: Feature request: cpplint should check for braces -
                    rule 3
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Minor
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: luciano.wolf at openbossa.org
                CC: kenneth.christiansen at openbossa.org


According to Braces rule 3 of the Webkit coding style guidelines[1]:
"One-line control clauses should not use braces unless ... a single statement
spans multiple lines."

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();

RIGHT CODING STYLE:

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

[1]
http://webkit.org/coding/coding-style.html

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list