Title: [176929] trunk/Tools
Revision
176929
Author
y...@igalia.com
Date
2014-12-07 11:58:13 -0800 (Sun, 07 Dec 2014)

Log Message

Update style checker to deal with "const override"
https://bugs.webkit.org/show_bug.cgi?id=139371

Reviewed by Csaba Osztrogonác.

check-webkit-style shouldn't complain about an open brace to start a
line after a function definition with const override.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_braces):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_brace_at_begin_of_line):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (176928 => 176929)


--- trunk/Tools/ChangeLog	2014-12-07 19:24:14 UTC (rev 176928)
+++ trunk/Tools/ChangeLog	2014-12-07 19:58:13 UTC (rev 176929)
@@ -1,3 +1,18 @@
+2014-12-07  Gwang Yoon Hwang  <y...@igalia.com>
+
+        Update style checker to deal with "const override"
+        https://bugs.webkit.org/show_bug.cgi?id=139371
+
+        Reviewed by Csaba Osztrogonác.
+
+        check-webkit-style shouldn't complain about an open brace to start a
+        line after a function definition with const override.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_braces):
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (CppStyleTest.test_brace_at_begin_of_line):
+
 2014-12-07  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK] Fix GObject DOM bindings API break tests after r176920

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2014-12-07 19:24:14 UTC (rev 176928)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2014-12-07 19:58:13 UTC (rev 176929)
@@ -2421,7 +2421,7 @@
         # We also allow '#' for #endif and '=' for array initialization,
         # and '- (' and '+ (' for Objective-C methods.
         previous_line = get_previous_non_blank_line(clean_lines, line_number)[0]
-        if ((not search(r'[;:}{)=]\s*$|\)\s*((const|override)\s*)?(->\s*\S+)?\s*$', previous_line)
+        if ((not search(r'[;:}{)=]\s*$|\)\s*((const|override|const override)\s*)?(->\s*\S+)?\s*$', previous_line)
              or search(r'\b(if|for|while|switch|else|NS_ENUM)\b', previous_line))
             and previous_line.find('#') < 0
             and previous_line.find('- (') != 0

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2014-12-07 19:24:14 UTC (rev 176928)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2014-12-07 19:58:13 UTC (rev 176929)
@@ -1651,6 +1651,11 @@
             '{\n'
             '}\n',
             '')
+        self.assert_multi_line_lint(
+            'int foo() const override\n'
+            '{\n'
+            '}\n',
+            '')
 
     def test_mismatching_spaces_in_parens(self):
         self.assert_lint('if (foo ) {', 'Extra space before ) in if'
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to