Changeset 53387 in webkit


Ignore:
Timestamp:
Jan 17, 2010 7:28:09 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-01-17 Adam Barth <abarth@webkit.org>

Reviewed by Darin Adler.

style-queue complains about one-line macros that include multiple statements
https://bugs.webkit.org/show_bug.cgi?id=33173

Add an exception for multiple statements on a line that starts a macro.

  • Scripts/webkitpy/style/cpp_style.py:
  • Scripts/webkitpy/style/cpp_style_unittest.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r53386 r53387  
     12010-01-17  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        style-queue complains about one-line macros that include multiple statements
     6        https://bugs.webkit.org/show_bug.cgi?id=33173
     7
     8        Add an exception for multiple statements on a line that starts a macro.
     9
     10        * Scripts/webkitpy/style/cpp_style.py:
     11        * Scripts/webkitpy/style/cpp_style_unittest.py:
     12
    1132010-01-17  Adam Barth  <abarth@webkit.org>
    214
  • trunk/WebKitTools/Scripts/webkitpy/style/cpp_style.py

    r53386 r53387  
    19391939        and not ((cleansed_line.find('case ') != -1
    19401940                  or cleansed_line.find('default:') != -1)
    1941                  and cleansed_line.find('break;') != -1)):
     1941                 and cleansed_line.find('break;') != -1)
     1942        and not cleansed_line.startswith('#define ')):
    19421943        error(filename, line_number, 'whitespace/newline', 4,
    19431944              'More than one command on the same line')
  • trunk/WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py

    r53386 r53387  
    30193019            '}\n',
    30203020            '')
    3021 
     3021        self.assert_multi_line_lint(
     3022            '#define TEST_ASSERT(expression) do { if (!(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0)\n',
     3023            '')
    30223024        self.assert_multi_line_lint(
    30233025            'if (condition) {\n'
Note: See TracChangeset for help on using the changeset viewer.