Title: [160772] trunk/Tools
Revision
160772
Author
[email protected]
Date
2013-12-18 10:06:13 -0800 (Wed, 18 Dec 2013)

Log Message

False webkit-check-style warnings on *.
https://bugs.webkit.org/show_bug.cgi?id=125915

Patch by Gergo Balogh <[email protected]> on 2013-12-18
Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_pointer_reference_marker_location):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (160771 => 160772)


--- trunk/Tools/ChangeLog	2013-12-18 18:02:14 UTC (rev 160771)
+++ trunk/Tools/ChangeLog	2013-12-18 18:06:13 UTC (rev 160772)
@@ -1,3 +1,15 @@
+2013-12-18  Gergo Balogh  <[email protected]>
+
+        False webkit-check-style warnings on *.
+        https://bugs.webkit.org/show_bug.cgi?id=125915
+
+        Reviewed by Darin Adler.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_spacing):
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (CppStyleTest.test_pointer_reference_marker_location):
+
 2013-12-18  Dániel Bátyai  <[email protected]>
 
         prepare-ChangeLog doesn't handle templates properly

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2013-12-18 18:02:14 UTC (rev 160771)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2013-12-18 18:06:13 UTC (rev 160772)
@@ -1924,8 +1924,8 @@
 
     if file_extension == 'cpp':
         # C++ should have the & or * beside the type not the variable name.
-        matched = match(r'\s*([\w\s]+)(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\s*\w+', line)
-        if matched:
+        matched = match(r'\s*(?P<pre_part>[\w\s]+)\s+(?P<pointer_operator>\*|\&)\s*\w+', line)
+        if matched and not matched.group('pre_part').startswith('return') and not matched.group('pre_part').startswith('delete'):
             error(line_number, 'whitespace/declaration', 3,
                   'Declaration has space between type name and %s in %s' % (matched.group('pointer_operator'), matched.group(0).strip()))
 

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2013-12-18 18:02:14 UTC (rev 160771)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2013-12-18 18:06:13 UTC (rev 160772)
@@ -2070,6 +2070,7 @@
                          'Declaration has space between type name and * in int * b  [whitespace/declaration] [3]',
                          'foo.cpp')
         self.assert_lint('return *b;', '', 'foo.cpp')
+        self.assert_lint('return a * b;', '', 'foo.cpp')
         self.assert_lint('delete *b;', '', 'foo.cpp')
         self.assert_lint('int *b;', '', 'foo.c')
         self.assert_lint('int* b;',
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to