[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
levin at chromium.org
levin at chromium.org
Wed Dec 22 17:57:24 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 15147334d7bd9b4af53367968e7e07dcdd83b81a
Author: levin at chromium.org <levin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 3 08:32:56 2010 +0000
2010-12-03 David Levin <levin at chromium.org>
Reviewed by Shinichiro Hamaji.
check-webkit-style: false positive reported for #if macro
https://bugs.webkit.org/show_bug.cgi?id=48242
* Scripts/webkitpy/style/checkers/cpp.py: Adjusted check to avoid
all preprocessor commands.
* Scripts/webkitpy/style/checkers/cpp_unittest.py: Added test.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index c880b01..0ace065 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-12-03 David Levin <levin at chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ check-webkit-style: false positive reported for #if macro
+ https://bugs.webkit.org/show_bug.cgi?id=48242
+
+ * Scripts/webkitpy/style/checkers/cpp.py: Adjusted check to avoid
+ all preprocessor commands.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added test.
+
2010-12-02 Eric Seidel <eric at webkit.org>
Reviewed by Adam Barth.
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index 590bba9..580eb58 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -1458,8 +1458,8 @@ def check_spacing(file_extension, clean_lines, line_number, error):
'Extra space before ) in %s' % statement)
# Do not check for more than one command in macros
- in_macro = match(r'\s*#define', line)
- if not in_macro and not match(r'((\s*{\s*}?)|(\s*;?))\s*\\?$', rest):
+ in_preprocessor_directive = match(r'\s*#', line)
+ if not in_preprocessor_directive and not match(r'((\s*{\s*}?)|(\s*;?))\s*\\?$', rest):
error(line_number, 'whitespace/parens', 4,
'More than one command on the same line in %s' % statement)
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index 13b053c..53fb15e 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -3152,6 +3152,14 @@ class WebKitStyleTest(CppStyleTestBase):
self.assert_multi_line_lint(
' if (condition) doIt();\n',
'More than one command on the same line in if [whitespace/parens] [4]')
+ # Ensure that having a # in the line doesn't hide the error.
+ self.assert_multi_line_lint(
+ ' x++; char a[] = "#";',
+ 'More than one command on the same line [whitespace/newline] [4]')
+ # Ignore preprocessor if's.
+ self.assert_multi_line_lint(
+ ' #if (condition) || (condition2)\n',
+ '')
# 2. An else statement should go on the same line as a preceding
# close brace if one is present, else it should line up with the
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list