⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 245870 in webkit


Ignore:
Timestamp:
May 29, 2019, 3:04:58 PM (7 years ago)
Author:
ddkilzer@apple.com
Message:

check-webkit-style reports false-positive build/include_order warning in WTF C++ source files
<https://webkit.org/b/198349>

Reviewed by Alex Christensen.

  • Scripts/webkitpy/style/checkers/cpp.py:

(_classify_include): Don't return early for <wtf/Header.h>
includes.

  • Scripts/webkitpy/style/checkers/cpp_unittest.py:

(OrderOfIncludesTest.test_primary_header): Add tests for
<wtf/Header.h> includes.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r245868 r245870  
     12019-05-29  David Kilzer  <ddkilzer@apple.com>
     2
     3        check-webkit-style reports false-positive build/include_order warning in WTF C++ source files
     4        <https://webkit.org/b/198349>
     5
     6        Reviewed by Alex Christensen.
     7
     8        * Scripts/webkitpy/style/checkers/cpp.py:
     9        (_classify_include): Don't return early for <wtf/Header.h>
     10        includes.
     11        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
     12        (OrderOfIncludesTest.test_primary_header): Add tests for
     13        <wtf/Header.h> includes.
     14
    1152019-05-29  Geoffrey Garen  <ggaren@apple.com>
    216
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

    r244688 r245870  
    30323032
    30333033    # If it is a system header we know it is classified as _OTHER_HEADER.
    3034     if is_system and not include.startswith('public/'):
     3034    if is_system and not include.startswith('public/') and not include.startswith('wtf/'):
    30353035        return _OTHER_HEADER
    30363036
  • trunk/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

    r244688 r245870  
    31303130                                         '#include "bar.h"\n',
    31313131                                         '')
     3132
    31323133        # Pretend that header files exist.
    31333134        os.path.isfile = lambda filename: True
     3135
    31343136        # Missing include for existing primary header -> error.
    31353137        self.assert_language_rules_check('foo.cpp',
     
    31403142                                         'Should be: config.h, primary header, blank line, and then '
    31413143                                         'alphabetically sorted.  [build/include_order] [4]')
     3144
    31423145        # *SoftLink.cpp files should not include their headers -> no error.
    31433146        self.assert_language_rules_check('FooSoftLink.cpp',
     
    31463149                                         '#include <wtf/SoftLinking.h>\n',
    31473150                                         '')
     3151
    31483152        # Having include for existing primary header -> no error.
    31493153        self.assert_language_rules_check('foo.cpp',
     
    31533157                                         '#include "bar.h"\n',
    31543158                                         '')
     3159
     3160        # Having include for existing WTF primary header -> no error.
     3161        self.assert_language_rules_check('foo.cpp',
     3162                                         '#include "config.h"\n'
     3163                                         '#include <wtf/foo.h>\n'
     3164                                         '\n'
     3165                                         '#include <wtf/bar.h>\n',
     3166                                         '')
     3167
     3168        # WTF primary header included out of order -> error.
     3169        self.assert_language_rules_check('foo.cpp',
     3170                                         '#include "config.h"\n'
     3171                                         '#include <wtf/bar.h>\n'
     3172                                         '\n'
     3173                                         '#include <wtf/foo.h>\n',
     3174                                         ['Found other header before a header this file implements. '
     3175                                          'Should be: config.h, primary header, blank line, and then '
     3176                                          'alphabetically sorted.  [build/include_order] [4]',
     3177                                          'Found header this file implements after other header. '
     3178                                          'Should be: config.h, primary header, blank line, and then '
     3179                                          'alphabetically sorted.  [build/include_order] [4]'])
    31553180
    31563181        os.path.isfile = self.os_path_isfile_orig
Note: See TracChangeset for help on using the changeset viewer.