[Webkit-unassigned] [Bug 124820] check-webkit-style should check member initialization indentation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Nov 28 23:12:18 PST 2013


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





--- Comment #5 from László Langó <lango at inf.u-szeged.hu>  2013-11-28 23:10:42 PST ---
(In reply to comment #4)
> (From update of attachment 217932 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=217932&action=review
> 
> > Tools/Scripts/webkitpy/style/checkers/cpp.py:1979
> > +    if search(r'\b([A-Za-z0-9_]*_)\(\1\)', line):
> 
> Why is there an underscore in the end of the first group?

I don't know, that is not my code. I just moved it into this new method, because this functionality should be here.
> 
> > Tools/Scripts/webkitpy/style/checkers/cpp.py:1997
> > +    if search(r'(?P<indentation>\s*)([^\s]\(.*\)\s?\:|^\s*\:).*[^;]*$', line):
> > +        if search(r'[^:]\:[^\:\s]+', line):
> > +            error(line_number, 'whitespace/init', 4,
> > +                'Missing spaces around :')
> > +        if search(r'[^\s]\(.*\)\s?\:.*[^;]*$', line):
> > +            error(line_number, 'whitespace/indent', 4,
> > +                'Should be indented on a separate line, with the colon or comma first on that line.')
> > +        else:
> > +            begin_line, begin_line_number = get_previous_non_blank_line(clean_lines, line_number)
> > +
> > +        matched = search(r'(?P<indentation>\s*).*', begin_line)
> 
> For this 'matched 'you could use the regex's return value in the if above.

No it's not the same. The base of the indention can be the previous non blank line. example:

    myClass()
        : myInt(0)
    { }

The above if you mentioned will match on the second line, but we need the indention of the first line.

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