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>
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 @@
# 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):