Changeset 52636 in webkit


Ignore:
Timestamp:
Dec 29, 2009 3:06:30 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-29 Chang Shu <Chang.Shu@nokia.com>

Reviewed by Adam Barth.

[Qt] Move logic that handles Qt headers before primary headers
so that Qt headers won't be treated as primary headers by mistake.
https://bugs.webkit.org/show_bug.cgi?id=32991

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

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r52628 r52636  
     12009-12-29  Chang Shu  <Chang.Shu@nokia.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        [Qt] Move logic that handles Qt headers before primary headers
     6        so that Qt headers won't be treated as primary headers by mistake.
     7        https://bugs.webkit.org/show_bug.cgi?id=32991
     8
     9        * Scripts/modules/cpp_style.py:
     10        * Scripts/modules/cpp_style_unittest.py:
     11
    1122009-12-29  Eric Seidel  <eric@webkit.org>
    213
  • trunk/WebKitTools/Scripts/modules/cpp_style.py

    r52575 r52636  
    22172217        return _OTHER_HEADER;
    22182218
     2219    # Qt's moc files do not follow the naming and ordering rules, so they should be skipped
     2220    if include.startswith('moc_') and include.endswith('.cpp'):
     2221        return _MOC_HEADER
     2222
     2223    if include.endswith('.moc'):
     2224        return _MOC_HEADER
     2225
    22192226    # If the target file basename starts with the include we're checking
    22202227    # then we consider it the primary header.
     
    22302237    elif include_state.visited_primary_section() and target_base == include_base:
    22312238        return _PRIMARY_HEADER
    2232 
    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
    22392239
    22402240    return _OTHER_HEADER
  • trunk/WebKitTools/Scripts/modules/cpp_style_unittest.py

    r52541 r52636  
    22222222                                          'Foo.h',
    22232223                                          False, include_state))
     2224        self.assertEqual(cpp_style._MOC_HEADER,
     2225                         classify_include('foo.cpp',
     2226                                          'foo.moc',
     2227                                          False, include_state))
     2228        self.assertEqual(cpp_style._MOC_HEADER,
     2229                         classify_include('foo.cpp',
     2230                                          'moc_foo.cpp',
     2231                                          False, include_state))
    22242232        # Tricky example where both includes might be classified as primary.
    22252233        self.assert_language_rules_check('ScrollbarThemeWince.cpp',
Note: See TracChangeset for help on using the changeset viewer.