You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2019/12/21 00:08:50 UTC

[kudu] 01/02: [clang-tidy] Remove inline comments in .clang-tidy config file

This is an automated email from the ASF dual-hosted git repository.

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

commit 6876aec4b6c2547f39d80462a3fe9a6fc12b9257
Author: Bankim Bhavsar <ba...@cloudera.com>
AuthorDate: Fri Dec 20 11:55:21 2019 -0800

    [clang-tidy] Remove inline comments in .clang-tidy config file
    
    Inline comments don't work inside a long string broken
    into multi-line strings.
    
    So move the comments above the Checks section.
    
    Verified by toggling the readability-magic-number check.
    
    Change-Id: Id2f073ff9d1e8edf7468bc4fa486fa7f16283ade
    Reviewed-on: http://gerrit.cloudera.org:8080/14940
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
    Tested-by: Kudu Jenkins
    Reviewed-by: Adar Dembo <ad...@cloudera.com>
---
 src/kudu/.clang-tidy | 42 ++++++++++++++++++++++++------------------
 1 file changed, 24 insertions(+), 18 deletions(-)

diff --git a/src/kudu/.clang-tidy b/src/kudu/.clang-tidy
index 1b6c4ea..eef32cb 100644
--- a/src/kudu/.clang-tidy
+++ b/src/kudu/.clang-tidy
@@ -15,6 +15,30 @@
 # specific language governing permissions and limitations
 # under the License.
 
+# Explanation of some Checks are separate since we can't inline comments below.
+#
+# 'llvm-include-order'
+# 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.
+#
+# 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
+#
+# 'readability-magic-numbers'
+# Although useful in production code, we use magic numbers liberally in
+# tests, and many would be net less clear as named constants.
+
 Checks: >-
   -*,
   bugprone-*,
@@ -25,22 +49,6 @@ Checks: >-
   google-*,
   -google-readability-braces-around-statements,
   hicpp-noexcept-move,
-  # 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.
-  #
-  # 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,
   misc-*,
   -modernize-*,
@@ -53,8 +61,6 @@ Checks: >-
   readability-*,
   -readability-braces-around-statements,
   -readability-implicit-bool-conversion,
-  # 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,
   -readability-redundant-string-init
 HeaderFilterRegex: '.*,-*.pb.h'