From fbc762fa1de30b333d583531942d6d05ec3068bc Mon Sep 17 00:00:00 2001 From: "abarth@webkit.org" Date: Tue, 1 Dec 2009 16:46:48 +0000 Subject: [PATCH 1/1] 2009-12-01 Adam Barth Reviewed by Eric Seidel. check-webkit-style complains about #imports with / in them https://bugs.webkit.org/show_bug.cgi?id=32022 We need to exclude #import directives in addition to #include from the binary operator whitespace checks. * Scripts/modules/cpp_style.py: * Scripts/modules/cpp_style_unittest.py: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51541 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKitTools/ChangeLog | 13 +++++++++++++ WebKitTools/Scripts/modules/cpp_style.py | 6 +++--- WebKitTools/Scripts/modules/cpp_style_unittest.py | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 651f1ff0c426..aeb223a99320 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,16 @@ +2009-12-01 Adam Barth + + Reviewed by Eric Seidel. + + check-webkit-style complains about #imports with / in them + https://bugs.webkit.org/show_bug.cgi?id=32022 + + We need to exclude #import directives in addition to #include from the + binary operator whitespace checks. + + * Scripts/modules/cpp_style.py: + * Scripts/modules/cpp_style_unittest.py: + 2009-11-30 Adam Barth Reviewed by Eric Seidel. diff --git a/WebKitTools/Scripts/modules/cpp_style.py b/WebKitTools/Scripts/modules/cpp_style.py index 842b16fb4433..3207dbaa12bc 100644 --- a/WebKitTools/Scripts/modules/cpp_style.py +++ b/WebKitTools/Scripts/modules/cpp_style.py @@ -1533,9 +1533,9 @@ def check_spacing(filename, clean_lines, line_number, error): # Don't try to do spacing checks for operator methods line = re.sub(r'operator(==|!=|<|<<|<=|>=|>>|>)\(', 'operator\(', line) - # Don't try to do spacing checks for #include statements at minimum it - # messes up checks for spacing around / - if match(r'\s*#\s*include', line): + # Don't try to do spacing checks for #include or #import statements at + # minimum because it messes up checks for spacing around / + if match(r'\s*#\s*(?:include|import)', line): return if search(r'[\w.]=[\w.]', line): error(filename, line_number, 'whitespace/operators', 4, diff --git a/WebKitTools/Scripts/modules/cpp_style_unittest.py b/WebKitTools/Scripts/modules/cpp_style_unittest.py index d5637f484220..aa875883f2c3 100644 --- a/WebKitTools/Scripts/modules/cpp_style_unittest.py +++ b/WebKitTools/Scripts/modules/cpp_style_unittest.py @@ -1271,6 +1271,8 @@ class CppStyleTest(CppStyleTestBase): self.assert_lint('a = 1 << 20', '') self.assert_multi_line_lint('#include "config.h"\n#include \n', '') + self.assert_multi_line_lint('#include "config.h"\n#import \n', + '') def test_spacing_before_last_semicolon(self): self.assert_lint('call_function() ;', -- 2.36.0