[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
eric at webkit.org
eric at webkit.org
Thu Oct 29 20:38:47 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 5cc3349e147c7bed9784554b83eb4a4219b266c5
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Oct 4 21:12:25 2009 +0000
2009-10-04 Carol Szabo <carol.szabo at nokia.com>
Reviewed by David Levin.
check-webkit-style misses whitespace errors for operators:
<<, >>, <<=, >>=, &=, |=, +=, -=, *=, /=, /, |, &&, ||.
https://bugs.webkit.org/show_bug.cgi?id=30021
* Scripts/modules/cpp_style.py:
Added the operators mentioned above to the same list as == and !=.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 24bf561..8ff9f43 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-04 Carol Szabo <carol.szabo at nokia.com>
+
+ Reviewed by David Levin.
+
+ check-webkit-style misses whitespace errors for operators:
+ <<, >>, <<=, >>=, &=, |=, +=, -=, *=, /=, /, |, &&, ||.
+ https://bugs.webkit.org/show_bug.cgi?id=30021
+
+ * Scripts/modules/cpp_style.py:
+ Added the operators mentioned above to the same list as == and !=.
+
2009-10-02 Julie Parent <jparent at chromium.org>
Unreviewed.
diff --git a/WebKitTools/Scripts/modules/cpp_style.py b/WebKitTools/Scripts/modules/cpp_style.py
index a6e62b8..0c9dfa0 100644
--- a/WebKitTools/Scripts/modules/cpp_style.py
+++ b/WebKitTools/Scripts/modules/cpp_style.py
@@ -1548,7 +1548,7 @@ def check_spacing(filename, clean_lines, line_number, error):
# Alas, we can't test < or > because they're legitimately used sans spaces
# (a->b, vector<int> a). The only time we can tell is a < with no >, and
# only if it's not template params list spilling into the next line.
- matched = search(r'[^<>=!\s](==|!=|<=|>=)[^<>=!\s]', line)
+ matched = search(r'[^<>=!\s](==|!=|\+=|-=|\*=|/=|/|\|=|&=|<<=|>>=|<=|>=|\|\||\||&&|>>|<<)[^<>=!\s]', line)
if not matched:
# Note that while it seems that the '<[^<]*' term in the following
# regexp could be simplified to '<.*', which would indeed match
@@ -1561,7 +1561,7 @@ def check_spacing(filename, clean_lines, line_number, error):
'Missing spaces around %s' % matched.group(1))
# We allow no-spaces around << and >> when used like this: 10<<20, but
# not otherwise (particularly, not when used as streams)
- matched = search(r'[^0-9\s](<<|>>)[^0-9\s]', line)
+ matched = search(r'[^0-9\s](<<|>>)[^0-9\s=]', line)
if matched:
error(filename, line_number, 'whitespace/operators', 3,
'Missing spaces around %s' % matched.group(1))
diff --git a/WebKitTools/Scripts/modules/cpp_style_unittest.py b/WebKitTools/Scripts/modules/cpp_style_unittest.py
index 2498b39..322356e 100644
--- a/WebKitTools/Scripts/modules/cpp_style_unittest.py
+++ b/WebKitTools/Scripts/modules/cpp_style_unittest.py
@@ -951,7 +951,7 @@ class CppStyleTest(CppStyleTestBase):
self.assert_lint('int a[sizeof(struct Foo)];', '')
self.assert_lint('int a[128 - sizeof(const bar)];', '')
self.assert_lint('int a[(sizeof(foo) * 4)];', '')
- self.assert_lint('int a[(arraysize(fixed_size_array)/2) << 1];', '')
+ self.assert_lint('int a[(arraysize(fixed_size_array)/2) << 1];', 'Missing spaces around / [whitespace/operators] [3]')
self.assert_lint('delete a[some_var];', '')
self.assert_lint('return a[some_var];', '')
@@ -1209,6 +1209,62 @@ class CppStyleTest(CppStyleTestBase):
self.assert_lint('typedef hash_map<Foo, Bar', 'Missing spaces around <'
' [whitespace/operators] [3]')
self.assert_lint('typedef hash_map<FoooooType, BaaaaarType,', '')
+ self.assert_lint('a<Foo> t+=b;', 'Missing spaces around +='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo> t-=b;', 'Missing spaces around -='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t*=b;', 'Missing spaces around *='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t/=b;', 'Missing spaces around /='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t|=b;', 'Missing spaces around |='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t&=b;', 'Missing spaces around &='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t<<=b;', 'Missing spaces around <<='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t>>=b;', 'Missing spaces around >>='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t>>=&b|c;', 'Missing spaces around >>='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t<<=*b/c;', 'Missing spaces around <<='
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo> t -= b;', '')
+ self.assert_lint('a<Foo> t += b;', '')
+ self.assert_lint('a<Foo*> t *= b;', '')
+ self.assert_lint('a<Foo*> t /= b;', '')
+ self.assert_lint('a<Foo*> t |= b;', '')
+ self.assert_lint('a<Foo*> t &= b;', '')
+ self.assert_lint('a<Foo*> t <<= b;', '')
+ self.assert_lint('a<Foo*> t >>= b;', '')
+ self.assert_lint('a<Foo*> t >>= &b|c;', 'Missing spaces around |'
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t <<= *b/c;', 'Missing spaces around /'
+ ' [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t <<= b/c; //Test', ['At least two spaces'
+ ' is best between code and comments [whitespace/'
+ 'comments] [2]', 'Should have a space between // '
+ 'and comment [whitespace/comments] [4]', 'Missing'
+ ' spaces around / [whitespace/operators] [3]'])
+ self.assert_lint('a<Foo*> t <<= b||c; //Test', ['Should have a space'
+ ' between // and comment [whitespace/comments] [4]',
+ 'Missing spaces around || [whitespace/operators] [3]'])
+ self.assert_lint('a<Foo*> t <<= b&&c; // Test', 'Missing spaces around'
+ ' && [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t <<= b&&&c; // Test', 'Missing spaces around'
+ ' && [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t <<= b&&*c; // Test', 'Missing spaces around'
+ ' && [whitespace/operators] [3]')
+ self.assert_lint('a<Foo*> t <<= b && *c; // Test', '')
+ self.assert_lint('a<Foo*> t <<= b && &c; // Test', '')
+ self.assert_lint('a<Foo*> t <<= b || &c; /*Test', 'Complex multi-line '
+ '/*...*/-style comment found. Lint may give bogus '
+ 'warnings. Consider replacing these with //-style'
+ ' comments, with #if 0...#endif, or with more clearly'
+ ' structured multi-line comments. [readability/multiline_comment] [5]')
+ self.assert_lint('a<Foo&> t <<= &b | &c;', '')
+ self.assert_lint('a<Foo*> t <<= &b & &c; // Test', '')
+ self.assert_lint('a<Foo*> t <<= *b / &c; // Test', '')
def test_spacing_before_last_semicolon(self):
self.assert_lint('call_function() ;',
@@ -2960,7 +3016,7 @@ class WebKitStyleTest(CppStyleTestBase):
'Missing space after , [whitespace/comma] [3]')
self.assert_multi_line_lint(
'c = a|b;',
- '')
+ 'Missing spaces around | [whitespace/operators] [3]')
# FIXME: We cannot catch this lint error.
# self.assert_multi_line_lint(
# 'return condition ? 1:0;',
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list