[Webkit-unassigned] [Bug 27354] New: cpplint should check for one line control statements surrounded by braces

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 16 14:55:13 PDT 2009


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

           Summary: cpplint should check for one line control statements
                    surrounded by braces
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: treat at kde.org


cpplint should check for this:

One-line control clauses should not use braces unless comments are included or
a single statement spans multiple lines.
Right:
if (condition)
    doIt();

if (condition) {
    // Some comment
    doIt();
}

if (condition) {
    myFunction(reallyLongParam1, reallyLongParam2, ...
        reallyLongParam5);
}
Wrong:
if (condition) {
    doIt();
}

if (condition)
    // Some comment
    doIt();

if (condition)
    myFunction(reallyLongParam1, reallyLongParam2, ...
        reallyLongParam5);

-- 
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