Changeset 100499 in webkit
- Timestamp:
- Nov 16, 2011 1:51:15 PM (12 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r100494 r100499 1 2011-11-16 David Levin <levin@chromium.org> 2 3 check-webkit-style should recognize functions even if they have OVERRIDE after them. 4 https://bugs.webkit.org/show_bug.cgi?id=72515 5 6 Reviewed by Adam Barth. 7 8 * Scripts/webkitpy/style/checkers/cpp.py: 9 * Scripts/webkitpy/style/checkers/cpp_unittest.py: 10 1 11 2011-11-16 Tony Chang <tony@chromium.org> 2 12 -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
r98950 r100499 2144 2144 # We also allow '#' for #endif and '=' for array initialization. 2145 2145 previous_line = get_previous_non_blank_line(clean_lines, line_number)[0] 2146 if ((not search(r'[;:}{)=]\s*$|\)\s* const\s*$', previous_line)2146 if ((not search(r'[;:}{)=]\s*$|\)\s*((const|OVERRIDE)\s*)*\s*$', previous_line) 2147 2147 or search(r'\b(if|for|foreach|while|switch|else)\b', previous_line)) 2148 2148 and previous_line.find('#') < 0): 2149 2149 error(line_number, 'whitespace/braces', 4, 2150 2150 'This { should be at the end of the previous line') 2151 elif (search(r'\)\s*( const\s*)?{\s*$', line)2151 elif (search(r'\)\s*(((const|OVERRIDE)\s*)*\s*)?{\s*$', line) 2152 2152 and line.count('(') == line.count(')') 2153 2153 and not search(r'\b(if|for|foreach|while|switch)\b', line) -
trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py
r98950 r100499 1531 1531 'Place brace on its own line for function definitions. [whitespace/braces] [4]') 1532 1532 self.assert_multi_line_lint( 1533 'int foo() const OVERRIDE {', 1534 'Place brace on its own line for function definitions. [whitespace/braces] [4]') 1535 self.assert_multi_line_lint( 1536 'int foo() OVERRIDE {', 1537 'Place brace on its own line for function definitions. [whitespace/braces] [4]') 1538 self.assert_multi_line_lint( 1533 1539 'int foo() const\n' 1540 '{\n' 1541 '}\n', 1542 '') 1543 self.assert_multi_line_lint( 1544 'int foo() OVERRIDE\n' 1534 1545 '{\n' 1535 1546 '}\n',
Note: See TracChangeset
for help on using the changeset viewer.