Changeset 176718 in webkit


Ignore:
Timestamp:
Dec 3, 2014 5:32:01 AM (9 years ago)
Author:
commit-queue@webkit.org
Message:

check-webkit-style is confused by ternary expression inside first member initializer
https://bugs.webkit.org/show_bug.cgi?id=136442

Patch by Renato Nagy <rnagy@inf.u-szeged.hu> on 2014-12-03
Reviewed by Csaba Osztrogonác.

  • Scripts/webkitpy/style/checkers/cpp.py:

(check_member_initialization_list):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r176717 r176718  
     12014-12-03  Renato Nagy  <rnagy@inf.u-szeged.hu>
     2
     3        check-webkit-style is confused by ternary expression inside first member initializer
     4        https://bugs.webkit.org/show_bug.cgi?id=136442
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        * Scripts/webkitpy/style/checkers/cpp.py:
     9        (check_member_initialization_list):
     10
    1112014-12-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    212
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

    r173174 r176718  
    20442044            error(line_number, 'whitespace/init', 4,
    20452045                'Missing spaces around :')
    2046         if search(r'[^\s]\(.*\)\s?\:.*[^;]*$', line):
     2046        if (not line.lstrip().startswith(':')) and search(r'[^\s]\(.*\)\s?\:.*[^;]*$', line):
    20472047            error(line_number, 'whitespace/indent', 4,
    20482048                'Should be indented on a separate line, with the colon or comma first on that line.')
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

    r174136 r176718  
    50885088        'Should be indented on a separate line, with the colon or comma first on that line.'
    50895089        '  [whitespace/indent] [4]')
     5090        self.assert_multi_line_lint((
     5091            'MyClass::MyClass(Document* doc)\n'
     5092            '    : m_myMember(b ? bar() : baz())\n'
     5093            '    , MySuperClass()\n'
     5094            '    , m_doc(0)\n'
     5095            '{ }'), '')
    50905096        self.assert_multi_line_lint('''\
    50915097        MyClass::MyClass(Document* doc) : MySuperClass()
Note: See TracChangeset for help on using the changeset viewer.