Changeset 52575 in webkit


Ignore:
Timestamp:
Dec 27, 2009 1:11:20 AM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-27 Yael Aharon <yael.aharon@nokia.com>

Reviewed by Darin Adler.

check-webkit-style should not mark moc files inclusion as errors
https://bugs.webkit.org/show_bug.cgi?id=32669

Add a new header type for moc files, and skip them when checking the order of header files.

  • Scripts/modules/cpp_style.py:
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r52568 r52575  
     12009-12-27  Yael Aharon  <yael.aharon@nokia.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        check-webkit-style should not mark moc files inclusion as errors
     6        https://bugs.webkit.org/show_bug.cgi?id=32669
     7
     8        Add a new header type for moc files, and skip them when checking the order of header files.
     9
     10        * Scripts/modules/cpp_style.py:
     11
    1122009-12-26  Adam Barth  <abarth@webkit.org>
    213
  • trunk/WebKitTools/Scripts/modules/cpp_style.py

    r52541 r52575  
    124124_PRIMARY_HEADER = 1
    125125_OTHER_HEADER = 2
     126_MOC_HEADER = 3
    126127
    127128
     
    182183        _PRIMARY_HEADER: 'header this file implements',
    183184        _OTHER_HEADER: 'other header',
     185        _MOC_HEADER: 'moc file',
    184186        }
    185187    _SECTION_NAMES = {
     
    218220        if header_type == _PRIMARY_HEADER and file_is_header:
    219221            return 'Header file should not contain itself.'
     222        if header_type == _MOC_HEADER:
     223            return ''
    220224
    221225        error_message = ''
     
    22272231        return _PRIMARY_HEADER
    22282232
     2233    # Qt's moc files do not follow the naming and ordering rules, so they should be skipped
     2234    if include.startswith('moc_') and include.endswith('.cpp'):
     2235        return _MOC_HEADER
     2236
     2237    if include.endswith('.moc'):
     2238        return _MOC_HEADER
     2239
    22292240    return _OTHER_HEADER
    22302241
     
    22972308
    22982309    # Check to make sure all headers besides config.h and the primary header are
    2299     # alphabetically sorted.
     2310    # alphabetically sorted. Skip Qt's moc files.
    23002311    if not error_message and header_type == _OTHER_HEADER:
    23012312         previous_line_number = line_number - 1;
Note: See TracChangeset for help on using the changeset viewer.