Title: [176718] trunk/Tools
Revision
176718
Author
commit-qu...@webkit.org
Date
2014-12-03 05:32:01 -0800 (Wed, 03 Dec 2014)

Log 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 <rn...@inf.u-szeged.hu> on 2014-12-03
Reviewed by Csaba Osztrogonác.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_member_initialization_list):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (176717 => 176718)


--- trunk/Tools/ChangeLog	2014-12-03 12:20:55 UTC (rev 176717)
+++ trunk/Tools/ChangeLog	2014-12-03 13:32:01 UTC (rev 176718)
@@ -1,3 +1,13 @@
+2014-12-03  Renato Nagy  <rn...@inf.u-szeged.hu>
+
+        check-webkit-style is confused by ternary _expression_ inside first member initializer
+        https://bugs.webkit.org/show_bug.cgi?id=136442
+
+        Reviewed by Csaba Osztrogonác.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_member_initialization_list):
+
 2014-12-03  Carlos Alberto Lopez Perez  <clo...@igalia.com>
 
         [GTK] [JHBuild] gst-plugins-bad fails to build if the GNUStep libraries are installed.

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (176717 => 176718)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2014-12-03 12:20:55 UTC (rev 176717)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2014-12-03 13:32:01 UTC (rev 176718)
@@ -2043,7 +2043,7 @@
         if search(r'[^:]\:[^\:\s]+', line):
             error(line_number, 'whitespace/init', 4,
                 'Missing spaces around :')
-        if search(r'[^\s]\(.*\)\s?\:.*[^;]*$', line):
+        if (not line.lstrip().startswith(':')) and 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:

Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py (176717 => 176718)


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2014-12-03 12:20:55 UTC (rev 176717)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2014-12-03 13:32:01 UTC (rev 176718)
@@ -5087,6 +5087,12 @@
         self.assert_lint('MyClass::MyClass(Document* doc) : MySuperClass() { }',
         'Should be indented on a separate line, with the colon or comma first on that line.'
         '  [whitespace/indent] [4]')
+        self.assert_multi_line_lint((
+            'MyClass::MyClass(Document* doc)\n'
+            '    : m_myMember(b ? bar() : baz())\n'
+            '    , MySuperClass()\n'
+            '    , m_doc(0)\n'
+            '{ }'), '')
         self.assert_multi_line_lint('''\
         MyClass::MyClass(Document* doc) : MySuperClass()
         { }''',
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to