Bug 27567

Summary: False positives in namespace indentation checks
Product: WebKit Reporter: Jakob Petsovits <jpetsovits>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: manyoso, simon.maxime
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Fix false positives in namespace indentation checks
manyoso: review-
Fix false positives in namespace indentation checks (try 2) manyoso: review+

Description Jakob Petsovits 2009-07-22 15:00:22 PDT
Yong Li discovered a false positive for the namespace indentation check in implementation files, triggered by this piece of code:

"""
namespace WebCore {

PlatformMenuDescriptionType::PlatformMenuDescriptionType()
    : hMenu(::CreatePopupMenu())
    , itemCount(0)
{
}
"""

It turns out that the regular expression skipping goto labels was too permissive, and thus treated the line with the constructor's signature as label, skipping it and (then correctly) causing the error for the indented second line. Not cool, sorry for that bug.

This patch improves on the concerned code, makes the unit tests more demanding, and fixes the bug. Please review!
Comment 1 Jakob Petsovits 2009-07-22 15:02:12 PDT
Created attachment 33298 [details]
Fix false positives in namespace indentation checks
Comment 2 Adam Treat 2009-07-22 15:09:59 PDT
Comment on attachment 33298 [details]
Fix false positives in namespace indentation checks

Next time put more detail in the ChangeLog as you did in the bug report.

Also, I'd like a comment for the added regex.
Comment 3 Jakob Petsovits 2009-07-22 15:20:06 PDT
Created attachment 33300 [details]
Fix false positives in namespace indentation checks (try 2)

Better patch, more verbosely describing what is being done. (No changes in functionality, though.)
Comment 4 Adam Treat 2009-07-22 15:31:35 PDT
Landed with r46248.
Comment 5 Maxime Simon 2009-07-22 23:05:19 PDT
*** Bug 27559 has been marked as a duplicate of this bug. ***