Changeset 79102 in webkit
- Timestamp:
- Feb 18, 2011 10:52:15 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r79096 r79102 1 2011-02-18 David Levin <levin@chromium.org> 2 3 Reviewed by Eric Seidel. 4 5 check-webkit-style: Misses brace style error when the line with the { has a } in it. 6 https://bugs.webkit.org/show_bug.cgi?id=54769 7 8 * Scripts/webkitpy/style/checkers/cpp.py: Fixed the check for the close brace 9 to only look after the last open brace, so that the open brace in this line 10 "} else {" will still be able to trigger the error. 11 * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added related unit tests. 12 1 13 2011-02-18 Zan Dobersek <zandobersek@gmail.com> 2 14 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r79095 r79102 2128 2128 # one line control statement was previous. 2129 2129 previous_line = clean_lines.elided[line_number - 2] 2130 if (previous_line.find('{') > 0 and previous_line.find('}') < 0 2130 last_open_brace = previous_line.rfind('{') 2131 if (last_open_brace != -1 and previous_line.find('}', last_open_brace) == -1 2131 2132 and search(r'\b(if|for|foreach|while|else)\b', previous_line)): 2132 2133 error(line_number, 'whitespace/braces', 4, -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r79095 r79102 3617 3617 'One line control clauses should not use braces. [whitespace/braces] [4]']) 3618 3618 self.assert_multi_line_lint( 3619 'if (condition)\n' 3620 ' doSomething();\n' 3621 'else {\n' 3622 ' doSomethingElse();\n' 3623 '}\n', 3624 'One line control clauses should not use braces. [whitespace/braces] [4]') 3625 self.assert_multi_line_lint( 3626 'if (condition) {\n' 3627 ' doSomething1();\n' 3628 ' doSomething2();\n' 3629 '} else {\n' 3630 ' doSomethingElse();\n' 3631 '}\n', 3632 'One line control clauses should not use braces. [whitespace/braces] [4]') 3633 self.assert_multi_line_lint( 3619 3634 'void func()\n' 3620 3635 '{\n'
Note: See TracChangeset
for help on using the changeset viewer.