[check-webkit-style] .lut.h files shouldn't raise a sorting issue
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jul 2015 08:15:48 +0000 (08:15 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Jul 2015 08:15:48 +0000 (08:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=147146

Reviewed by Darin Adler.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_include_line): Avoid checking previous lines if it it is a lut.h include.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(OrderOfIncludesTest.test_check_alphabetical_include_order): Added test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187154 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/style/checkers/cpp.py
Tools/Scripts/webkitpy/style/checkers/cpp_unittest.py

index e049492..9ccc6d7 100644 (file)
@@ -1,3 +1,15 @@
+2015-07-22  Xabier Rodriguez Calvar  <calvaris@igalia.com>
+
+        [check-webkit-style] .lut.h files shouldn't raise a sorting issue
+        https://bugs.webkit.org/show_bug.cgi?id=147146
+
+        Reviewed by Darin Adler.
+
+        * Scripts/webkitpy/style/checkers/cpp.py:
+        (check_include_line): Avoid checking previous lines if it it is a lut.h include.
+        * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+        (OrderOfIncludesTest.test_check_alphabetical_include_order): Added test.
+
 2015-07-21  Filip Pizlo  <fpizlo@apple.com>
 
         Fixed VM pool allocation should have a reserve for allocations that cannot fail
index a7569ec..32de614 100644 (file)
@@ -3024,7 +3024,7 @@ def check_include_line(filename, file_extension, clean_lines, line_number, inclu
 
     # Check to make sure all headers besides config.h and the primary header are
     # alphabetically sorted.
-    if not error_message and header_type == _OTHER_HEADER:
+    if not error_message and header_type == _OTHER_HEADER and not search(r'\A#include.*\.lut\.h', line):
         previous_line_number = line_number - 1
         previous_line = clean_lines.lines[previous_line_number]
         previous_match = _RE_PATTERN_INCLUDE.search(previous_line)
index 7a168a2..4068fea 100644 (file)
@@ -2699,6 +2699,11 @@ class OrderOfIncludesTest(CppStyleTestBase):
                                          '#include <assert.h>\n',
                                          '')
 
+        self.assert_language_rules_check('foo.h',
+                                         '#include "bar.h"\n'
+                                         '#include "array.lut.h"\n',
+                                         '')
+
     def test_check_alphabetical_include_order_errors_reported_for_both_lines(self):
         # If one of the two lines of out of order headers are filtered, the error should be
         # reported on the other line.