Changeset 49078 in webkit
- Timestamp:
- Oct 4, 2009 2:12:25 PM (15 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r49058 r49078 1 2009-10-04 Carol Szabo <carol.szabo@nokia.com> 2 3 Reviewed by David Levin. 4 5 check-webkit-style misses whitespace errors for operators: 6 <<, >>, <<=, >>=, &=, |=, +=, -=, *=, /=, /, |, &&, ||. 7 https://bugs.webkit.org/show_bug.cgi?id=30021 8 9 * Scripts/modules/cpp_style.py: 10 Added the operators mentioned above to the same list as == and !=. 11 1 12 2009-10-02 Julie Parent <jparent@chromium.org> 2 13 -
trunk/WebKitTools/Scripts/modules/cpp_style.py
r48187 r49078 1549 1549 # (a->b, vector<int> a). The only time we can tell is a < with no >, and 1550 1550 # only if it's not template params list spilling into the next line. 1551 matched = search(r'[^<>=!\s](==|!=| <=|>=)[^<>=!\s]', line)1551 matched = search(r'[^<>=!\s](==|!=|\+=|-=|\*=|/=|/|\|=|&=|<<=|>>=|<=|>=|\|\||\||&&|>>|<<)[^<>=!\s]', line) 1552 1552 if not matched: 1553 1553 # Note that while it seems that the '<[^<]*' term in the following … … 1562 1562 # We allow no-spaces around << and >> when used like this: 10<<20, but 1563 1563 # not otherwise (particularly, not when used as streams) 1564 matched = search(r'[^0-9\s](<<|>>)[^0-9\s ]', line)1564 matched = search(r'[^0-9\s](<<|>>)[^0-9\s=]', line) 1565 1565 if matched: 1566 1566 error(filename, line_number, 'whitespace/operators', 3, -
trunk/WebKitTools/Scripts/modules/cpp_style_unittest.py
r47385 r49078 952 952 self.assert_lint('int a[128 - sizeof(const bar)];', '') 953 953 self.assert_lint('int a[(sizeof(foo) * 4)];', '') 954 self.assert_lint('int a[(arraysize(fixed_size_array)/2) << 1];', ' ')954 self.assert_lint('int a[(arraysize(fixed_size_array)/2) << 1];', 'Missing spaces around / [whitespace/operators] [3]') 955 955 self.assert_lint('delete a[some_var];', '') 956 956 self.assert_lint('return a[some_var];', '') … … 1210 1210 ' [whitespace/operators] [3]') 1211 1211 self.assert_lint('typedef hash_map<FoooooType, BaaaaarType,', '') 1212 self.assert_lint('a<Foo> t+=b;', 'Missing spaces around +=' 1213 ' [whitespace/operators] [3]') 1214 self.assert_lint('a<Foo> t-=b;', 'Missing spaces around -=' 1215 ' [whitespace/operators] [3]') 1216 self.assert_lint('a<Foo*> t*=b;', 'Missing spaces around *=' 1217 ' [whitespace/operators] [3]') 1218 self.assert_lint('a<Foo*> t/=b;', 'Missing spaces around /=' 1219 ' [whitespace/operators] [3]') 1220 self.assert_lint('a<Foo*> t|=b;', 'Missing spaces around |=' 1221 ' [whitespace/operators] [3]') 1222 self.assert_lint('a<Foo*> t&=b;', 'Missing spaces around &=' 1223 ' [whitespace/operators] [3]') 1224 self.assert_lint('a<Foo*> t<<=b;', 'Missing spaces around <<=' 1225 ' [whitespace/operators] [3]') 1226 self.assert_lint('a<Foo*> t>>=b;', 'Missing spaces around >>=' 1227 ' [whitespace/operators] [3]') 1228 self.assert_lint('a<Foo*> t>>=&b|c;', 'Missing spaces around >>=' 1229 ' [whitespace/operators] [3]') 1230 self.assert_lint('a<Foo*> t<<=*b/c;', 'Missing spaces around <<=' 1231 ' [whitespace/operators] [3]') 1232 self.assert_lint('a<Foo> t -= b;', '') 1233 self.assert_lint('a<Foo> t += b;', '') 1234 self.assert_lint('a<Foo*> t *= b;', '') 1235 self.assert_lint('a<Foo*> t /= b;', '') 1236 self.assert_lint('a<Foo*> t |= b;', '') 1237 self.assert_lint('a<Foo*> t &= b;', '') 1238 self.assert_lint('a<Foo*> t <<= b;', '') 1239 self.assert_lint('a<Foo*> t >>= b;', '') 1240 self.assert_lint('a<Foo*> t >>= &b|c;', 'Missing spaces around |' 1241 ' [whitespace/operators] [3]') 1242 self.assert_lint('a<Foo*> t <<= *b/c;', 'Missing spaces around /' 1243 ' [whitespace/operators] [3]') 1244 self.assert_lint('a<Foo*> t <<= b/c; //Test', ['At least two spaces' 1245 ' is best between code and comments [whitespace/' 1246 'comments] [2]', 'Should have a space between // ' 1247 'and comment [whitespace/comments] [4]', 'Missing' 1248 ' spaces around / [whitespace/operators] [3]']) 1249 self.assert_lint('a<Foo*> t <<= b||c; //Test', ['Should have a space' 1250 ' between // and comment [whitespace/comments] [4]', 1251 'Missing spaces around || [whitespace/operators] [3]']) 1252 self.assert_lint('a<Foo*> t <<= b&&c; // Test', 'Missing spaces around' 1253 ' && [whitespace/operators] [3]') 1254 self.assert_lint('a<Foo*> t <<= b&&&c; // Test', 'Missing spaces around' 1255 ' && [whitespace/operators] [3]') 1256 self.assert_lint('a<Foo*> t <<= b&&*c; // Test', 'Missing spaces around' 1257 ' && [whitespace/operators] [3]') 1258 self.assert_lint('a<Foo*> t <<= b && *c; // Test', '') 1259 self.assert_lint('a<Foo*> t <<= b && &c; // Test', '') 1260 self.assert_lint('a<Foo*> t <<= b || &c; /*Test', 'Complex multi-line ' 1261 '/*...*/-style comment found. Lint may give bogus ' 1262 'warnings. Consider replacing these with //-style' 1263 ' comments, with #if 0...#endif, or with more clearly' 1264 ' structured multi-line comments. [readability/multiline_comment] [5]') 1265 self.assert_lint('a<Foo&> t <<= &b | &c;', '') 1266 self.assert_lint('a<Foo*> t <<= &b & &c; // Test', '') 1267 self.assert_lint('a<Foo*> t <<= *b / &c; // Test', '') 1212 1268 1213 1269 def test_spacing_before_last_semicolon(self): … … 2961 3017 self.assert_multi_line_lint( 2962 3018 'c = a|b;', 2963 ' ')3019 'Missing spaces around | [whitespace/operators] [3]') 2964 3020 # FIXME: We cannot catch this lint error. 2965 3021 # self.assert_multi_line_lint(
Note: See TracChangeset
for help on using the changeset viewer.