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
+2009-12-01 Adam Barth <abarth@webkit.org>
+
+ 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 <abarth@webkit.org>
Reviewed by Eric Seidel.
# 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,
self.assert_lint('a = 1 << 20', '')
self.assert_multi_line_lint('#include "config.h"\n#include <sys/io.h>\n',
'')
+ self.assert_multi_line_lint('#include "config.h"\n#import <foo/bar.h>\n',
+ '')
def test_spacing_before_last_semicolon(self):
self.assert_lint('call_function() ;',