kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] 01/03: clang_tidy_gerrit: disable llvm-include-order check
Date Thu, 05 Dec 2019 07:04:39 GMT
This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit ddaf67d8b7a5f560fcd5645e14739da4ba478869
Author: Alexey Serbin <alexey@apache.org>
AuthorDate: Wed Dec 4 15:39:39 2019 -0800

    clang_tidy_gerrit: disable llvm-include-order check
    
    The 'llvm-include-order' check in clang-tidy contradicts with IWYU
    on the order of 'file.h' and 'file-inl.h' include file pairs.
    IWYU intentionally orders 'file-inl.h' and 'file.h' to make 'file.h'
    preceding it's 'file-inl.h' counterpart.  To avoid confusion, let's
    isable the 'llvm-include-order' check.
    
    Change-Id: Ie1f0e3a5b8447940be74071cc6701ac5eb5ddcf6
    Reviewed-on: http://gerrit.cloudera.org:8080/14839
    Tested-by: Alexey Serbin <aserbin@cloudera.com>
    Reviewed-by: Adar Dembo <adar@cloudera.com>
---
 build-support/clang_tidy_gerrit.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/build-support/clang_tidy_gerrit.py b/build-support/clang_tidy_gerrit.py
index 35b206a..cd500b1 100755
--- a/build-support/clang_tidy_gerrit.py
+++ b/build-support/clang_tidy_gerrit.py
@@ -49,6 +49,25 @@ DISABLED_TIDY_CHECKS=[
     # Although useful in production code, we use magic numbers liberally in
     # tests, and many would be net less clear as named constants.
     'readability-magic-numbers',
+
+    # IWYU has specific rules for ordering '-inl.h' include files, i.e.
+    # 'header.h' and its 'header-inl.h' counterpart. It seems in some cases
+    # including 'header-inl.h' before 'header.h' might even lead to compilation
+    # failures. So, IWYU intentionally re-orders them even if 'header-inl.h'
+    # comes before 'header.h' lexicographically in default C locale:
+    #   https://github.com/apache/kudu/blob/ \
+    #     89ce529e945731c48445db4a6f8af11f9f905aab/build-support/iwyu/ \
+    #     fix_includes.py#L1786-L1787
+    #
+    # That ordering contradicts with what clang-tidy recommends when using the
+    # 'llvm-include-order' check. To avoid confusion, let's disable the
+    # 'llvm-include-order'.
+    #
+    # TODO(aserbin): clarify whether it's possible to customize clang-tidy
+    #                behavior w.r.t. the sorting of such header files using
+    #                the format style options described at
+    #                https://clang.llvm.org/docs/ClangFormatStyleOptions.html
+    'llvm-include-order',
 ]
 
 def run_tidy(sha="HEAD", is_rev_range=False):


Mime
View raw message