Title: [160706] trunk/Tools
- Revision
- 160706
- Author
- [email protected]
- Date
- 2013-12-17 08:18:21 -0800 (Tue, 17 Dec 2013)
Log Message
Fix for C++ should have the & or * beside the type not the variable name check.
https://bugs.webkit.org/show_bug.cgi?id=125846
Patch by Gergo Balogh <[email protected]> on 2013-12-17
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 (160705 => 160706)
--- trunk/Tools/ChangeLog 2013-12-17 15:22:04 UTC (rev 160705)
+++ trunk/Tools/ChangeLog 2013-12-17 16:18:21 UTC (rev 160706)
@@ -1,3 +1,15 @@
+2013-12-17 Gergo Balogh <[email protected]>
+
+ Fix for C++ should have the & or * beside the type not the variable name check.
+ https://bugs.webkit.org/show_bug.cgi?id=125846
+
+ 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-16 Rob Buis <[email protected]>
Add my Samsung email address.
Modified: trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py (160705 => 160706)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2013-12-17 15:22:04 UTC (rev 160705)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py 2013-12-17 16:18:21 UTC (rev 160706)
@@ -1924,7 +1924,7 @@
if file_extension == 'cpp':
# C++ should have the & or * beside the type not the variable name.
- matched = match(r'\s*\w+(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\w+', line)
+ matched = match(r'\s*([\w\s]+)(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\s*\w+', line)
if matched:
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 (160705 => 160706)
--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2013-12-17 15:22:04 UTC (rev 160705)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py 2013-12-17 16:18:21 UTC (rev 160706)
@@ -2066,6 +2066,9 @@
self.assert_lint('int *b;',
'Declaration has space between type name and * in int *b [whitespace/declaration] [3]',
'foo.cpp')
+ self.assert_lint('int * b;',
+ '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('delete *b;', '', 'foo.cpp')
self.assert_lint('int *b;', '', 'foo.c')
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes