Commit ec58bb3c authored by eae@chromium.org's avatar 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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105652 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4de9c3dd
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
......@@ -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):
......
......@@ -1715,6 +1715,7 @@ class CppStyleTest(CppStyleTestBase):
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&);', '')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment