WebKit Bugzilla
Attachment 370883 Details for
Bug 198349
: check-webkit-style reports false-positive build/include_order warning in WTF C++ source files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-198349-20190529141717.patch (text/plain), 4.95 KB, created by
David Kilzer (:ddkilzer)
on 2019-05-29 14:17:18 PDT
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2019-05-29 14:17:18 PDT
Size:
4.95 KB
patch
obsolete
>Subversion Revision: 245854 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index d33b8af7c62cc8ccf1ce1ff2fd74a3ecfa27e5ea..27c3b9d91cd7138830253d9be341b3a2c45b68e0 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2019-05-29 David Kilzer <ddkilzer@apple.com> >+ >+ check-webkit-style reports false-positive build/include_order warning in WTF C++ source files >+ <https://webkit.org/b/198349> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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. >+ > 2019-05-29 Aakash Jain <aakash_jain@apple.com> > > Disable Flaky API Test TestWebKitAPI._WKDownload.DownloadMonitorCancel >diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp.py b/Tools/Scripts/webkitpy/style/checkers/cpp.py >index 4adde7aaf26bd5854862ef7dac5cd1fc35ec7b41..54b13683dda3ab3cd3df6f6e04b3681d8e5646ae 100644 >--- a/Tools/Scripts/webkitpy/style/checkers/cpp.py >+++ b/Tools/Scripts/webkitpy/style/checkers/cpp.py >@@ -3031,7 +3031,7 @@ def _classify_include(filename, include, is_system, include_state): > """ > > # If it is a system header we know it is classified as _OTHER_HEADER. >- if is_system and not include.startswith('public/'): >+ if is_system and not include.startswith('public/') and not include.startswith('wtf/'): > return _OTHER_HEADER > > # If the include is named config.h then this is WebCore/config.h. >diff --git a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py >index f8397e4e62e11b267c74a2a4ff6153448be7e384..73179ab74348e55061d5d5c446154fdf5fcb5a55 100644 >--- a/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py >+++ b/Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py >@@ -3129,8 +3129,10 @@ class OrderOfIncludesTest(CppStyleTestBase): > '\n' > '#include "bar.h"\n', > '') >+ > # Pretend that header files exist. > os.path.isfile = lambda filename: True >+ > # Missing include for existing primary header -> error. > self.assert_language_rules_check('foo.cpp', > '#include "config.h"\n' >@@ -3139,12 +3141,14 @@ class OrderOfIncludesTest(CppStyleTestBase): > 'Found other header before a header this file implements. ' > 'Should be: config.h, primary header, blank line, and then ' > 'alphabetically sorted. [build/include_order] [4]') >+ > # *SoftLink.cpp files should not include their headers -> no error. > self.assert_language_rules_check('FooSoftLink.cpp', > '#include "config.h"\n' > '\n' > '#include <wtf/SoftLinking.h>\n', > '') >+ > # Having include for existing primary header -> no error. > self.assert_language_rules_check('foo.cpp', > '#include "config.h"\n' >@@ -3153,6 +3157,27 @@ class OrderOfIncludesTest(CppStyleTestBase): > '#include "bar.h"\n', > '') > >+ # Having include for existing WTF primary header -> no error. >+ self.assert_language_rules_check('foo.cpp', >+ '#include "config.h"\n' >+ '#include <wtf/foo.h>\n' >+ '\n' >+ '#include <wtf/bar.h>\n', >+ '') >+ >+ # WTF primary header included out of order -> error. >+ self.assert_language_rules_check('foo.cpp', >+ '#include "config.h"\n' >+ '#include <wtf/bar.h>\n' >+ '\n' >+ '#include <wtf/foo.h>\n', >+ ['Found other header before a header this file implements. ' >+ 'Should be: config.h, primary header, blank line, and then ' >+ 'alphabetically sorted. [build/include_order] [4]', >+ 'Found header this file implements after other header. ' >+ 'Should be: config.h, primary header, blank line, and then ' >+ 'alphabetically sorted. [build/include_order] [4]']) >+ > os.path.isfile = self.os_path_isfile_orig > > def test_public_primary_header(self):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198349
: 370883