Skip to content

Commit

Permalink
check-webkit-style whitespace/operators triggers on overloaded divisi…
Browse files Browse the repository at this point in the history
…on operator

https://bugs.webkit.org/show_bug.cgi?id=76650

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_operator_methods):


Canonical link: https://commits.webkit.org/93686@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@105652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eaenet committed Jan 24, 2012
1 parent ab101ff commit 515d117
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,15 @@
2012-01-23 Emil A Eklund <eae@chromium.org>

check-webkit-style whitespace/operators triggers on overloaded division operator
https://bugs.webkit.org/show_bug.cgi?id=76650

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing):
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_operator_methods):

2012-01-23 Ryosuke Niwa <rniwa@webkit.org>

run-perf-tests should report server-side errors
Expand Down
2 changes: 1 addition & 1 deletion Tools/Scripts/webkitpy/style/checkers/cpp.py
Expand Up @@ -1808,7 +1808,7 @@ def check_spacing(file_extension, clean_lines, line_number, error):
line = clean_lines.elided[line_number] # get rid of comments and strings

# Don't try to do spacing checks for operator methods
line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>|\+=|-=|\*=|/=|%=|&=|\|=|^=|<<=|>>=)\(', 'operator\(', line)
line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>|\+=|-=|\*=|/=|%=|&=|\|=|^=|<<=|>>=|/)\(', 'operator\(', 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):
Expand Down
1 change: 1 addition & 0 deletions Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
Expand Up @@ -1715,6 +1715,7 @@ def test_spacing_for_binary_ops(self):

def test_operator_methods(self):
self.assert_lint('String operator+(const String&, const String&);', '')
self.assert_lint('String operator/(const String&, const String&);', '')
self.assert_lint('bool operator==(const String&, const String&);', '')
self.assert_lint('String& operator-=(const String&, const String&);', '')
self.assert_lint('String& operator+=(const String&, const String&);', '')
Expand Down

0 comments on commit 515d117

Please sign in to comment.