[Webkit-unassigned] [Bug 27615] New: Fix false positives for switch statement indentation check in cpplint

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 23 12:14:52 PDT 2009


           Summary: Fix false positives for switch statement indentation
                    check in cpplint
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jpetso at gmx.at

Mike Fenton brought to my attention that code like the following throws an
indentation warning in cpplint:

switch (blah) {
default: break;

As far as I can see, the styleguide doesn't specifically allow these kinds of
one-liners, but it also doesn't forbid them. And anyways, the error message for
the indentation check would be wrong in this case anyways:

"A case label should not be indented, but line up with its switch statement."

The patch below fixes this issues by making the case label regex more
permissive (hm... deja-vu?). It also adds more testcases and only ends the
check when the (supposed) closing brace for the switch is actually on the same
level of indentation as the switch statement itself. And a slight restructuring
of comments and (el)ifs for better readability.

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