Title: [220896] trunk/Tools
Revision
220896
Author
[email protected]
Date
2017-08-17 19:17:06 -0700 (Thu, 17 Aug 2017)

Log Message

check-webkit-style shouldn't check spacing in #elif preprocessor lines
https://bugs.webkit.org/show_bug.cgi?id=175652

Patch by Yoshiaki Jitsukawa <[email protected]> on 2017-08-17
Reviewed by Alex Christensen.

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

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (220895 => 220896)


--- trunk/Tools/ChangeLog	2017-08-18 01:34:16 UTC (rev 220895)
+++ trunk/Tools/ChangeLog	2017-08-18 02:17:06 UTC (rev 220896)
@@ -1,3 +1,15 @@
+2017-08-17  Yoshiaki Jitsukawa  <[email protected]>
+
+        check-webkit-style shouldn't check spacing in #elif preprocessor lines
+        https://bugs.webkit.org/show_bug.cgi?id=175652
+
+        Reviewed by Alex Christensen.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_spacing):
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (CppStyleTest.test_spacing_for_binary_ops):
+
 2017-08-17  Wenson Hsieh  <[email protected]>
 
         Fix the build on other platforms after r220865

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2017-08-18 01:34:16 UTC (rev 220895)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py	2017-08-18 02:17:06 UTC (rev 220896)
@@ -1869,9 +1869,9 @@
 
     # Don't try to do spacing checks for operator methods
     line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>|\+=|-=|\*=|/=|%=|&=|\|=|^=|<<=|>>=|/)\(', 'operator\(', line)
-    # Don't try to do spacing checks for #include, #import, or #if statements at
+    # Don't try to do spacing checks for #include, #import, #if, or #elif statements at
     # minimum because it messes up checks for spacing around /
-    if match(r'\s*#\s*(?:include|import|if)', line):
+    if match(r'\s*#\s*(?:include|import|if|elif)', line):
         return
     if not is_objective_c_property and not is_objective_c_synthesize and search(r'[\w.]=[\w.]', line):
         error(line_number, 'whitespace/operators', 4,

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


--- trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2017-08-18 01:34:16 UTC (rev 220895)
+++ trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py	2017-08-18 02:17:06 UTC (rev 220896)
@@ -2033,6 +2033,8 @@
         self.assert_multi_line_lint('#include <sys/io.h>\n', '')
         self.assert_multi_line_lint('#import <foo/bar.h>\n', '')
         self.assert_multi_line_lint('#if __has_include(<ApplicationServices/ApplicationServicesPriv.h>)\n', '')
+        self.assert_multi_line_lint('#elif __has_include(<ApplicationServices/ApplicationServicesPriv.h>)\n', '')
+        self.assert_multi_line_lint('#endif // __has_include(<ApplicationServices/ApplicationServicesPriv.h>)\n', '')
         self.assert_lint('Foo&& a = bar();', '')
 
     def test_operator_methods(self):
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to