Changeset 55656 in webkit


Ignore:
Timestamp:
Mar 7, 2010 10:55:55 PM (14 years ago)
Author:
hamaji@chromium.org
Message:

2010-03-07 Shinichiro Hamaji <hamaji@chromium.org>

Reviewed by Eric Seidel.

check-webkit-style: false positive for empty loop
https://bugs.webkit.org/show_bug.cgi?id=35717

  • Scripts/webkitpy/style/processors/cpp.py:
  • Scripts/webkitpy/style/processors/cpp_unittest.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r55655 r55656  
     12010-03-07  Shinichiro Hamaji  <hamaji@chromium.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        check-webkit-style: false positive for empty loop
     6        https://bugs.webkit.org/show_bug.cgi?id=35717
     7
     8        * Scripts/webkitpy/style/processors/cpp.py:
     9        * Scripts/webkitpy/style/processors/cpp_unittest.py:
     10
    1112010-03-07  Kent Tamura  <tkent@chromium.org>
    212
  • trunk/WebKitTools/Scripts/webkitpy/style/processors/cpp.py

    r55151 r55656  
    16531653        # one line control statement was previous.
    16541654        previous_line = clean_lines.elided[line_number - 2]
    1655         if (previous_line.find('{') > 0
     1655        if (previous_line.find('{') > 0 and previous_line.find('}') < 0
    16561656            and search(r'\b(if|for|foreach|while|else)\b', previous_line)):
    16571657            error(line_number, 'whitespace/braces', 4,
  • trunk/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py

    r55151 r55656  
    30653065            ['More than one command on the same line in if  [whitespace/parens] [4]',
    30663066             'One line control clauses should not use braces.  [whitespace/braces] [4]'])
     3067        self.assert_multi_line_lint(
     3068            'void func()\n'
     3069            '{\n'
     3070            '    while (condition) { }\n'
     3071            '    return 0;\n'
     3072            '}\n',
     3073            '')
     3074        self.assert_multi_line_lint(
     3075            'void func()\n'
     3076            '{\n'
     3077            '    for (i = 0; i < 42; i++) { foobar(); }\n'
     3078            '    return 0;\n'
     3079            '}\n',
     3080            'More than one command on the same line in for  [whitespace/parens] [4]')
    30673081
    30683082        # 3. An else if statement should be written as an if statement
Note: See TracChangeset for help on using the changeset viewer.