From ebb74e038ff255cdc856663e7c278743bc8c323b Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Wed, 18 Sep 2024 13:33:43 +0800 Subject: [PATCH] chore(CI): Sort disabled clang-tidy checks option (#2117) --- .clang-tidy | 4 +++- build_tools/clang_tidy.py | 35 ++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 20ca366c08..888e91b95b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -18,7 +18,9 @@ # https://releases.llvm.org/14.0.0/tools/clang/tools/extra/docs/clang-tidy/index.html CheckOptions: [] -Checks: 'abseil-*,boost-*,bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,darwin-*,fuchsia-*,google-*,hicpp-*,linuxkernel-*,llvm-*,misc-*,modernize-*,performance-*,portability-*,readability-*,-cppcoreguidelines-pro-type-union-access,-llvm-include-order,-misc-definitions-in-headers,-modernize-use-trailing-return-type,-cppcoreguidelines-macro-usage,-modernize-replace-disallow-copy-and-assign-macro,-bugprone-macro-parentheses,-cppcoreguidelines-avoid-non-const-global-variables,-fuchsia-statically-constructed-objects,-fuchsia-overloaded-operator,-bugprone-easily-swappable-parameters,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-hicpp-named-parameter,-readability-named-parameter,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-readability-function-cognitive-complexity,-cert-err58-cpp,-cppcoreguidelines-avoid-c-arrays,-hicpp-avoid-c-arrays,-modernize-avoid-c-arrays,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-type-const-cast,-concurrency-mt-unsafe,-readability-identifier-length,-fuchsia-default-arguments-calls,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-bugprone-lambda-function-name' +# Disable some checks that are not useful for us now. +# They are sorted by names, and should be consistent to build_tools/clang_tidy.py. +Checks: 'abseil-*,boost-*,bugprone-*,cert-*,clang-analyzer-*,concurrency-*,cppcoreguidelines-*,darwin-*,fuchsia-*,google-*,hicpp-*,linuxkernel-*,llvm-*,misc-*,modernize-*,performance-*,portability-*,readability-*,-bugprone-easily-swappable-parameters,-bugprone-lambda-function-name,-bugprone-macro-parentheses,-cert-err58-cpp,-concurrency-mt-unsafe,-cppcoreguidelines-avoid-c-arrays,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-avoid-non-const-global-variables,-cppcoreguidelines-macro-usage,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-union-access,-fuchsia-default-arguments-calls,-fuchsia-overloaded-operator,-fuchsia-statically-constructed-objects,-google-readability-avoid-underscore-in-googletest-name,-hicpp-avoid-c-arrays,-hicpp-named-parameter,-hicpp-no-array-decay,-llvm-include-order,-misc-definitions-in-headers,-misc-non-private-member-variables-in-classes,-modernize-avoid-c-arrays,-modernize-replace-disallow-copy-and-assign-macro,-modernize-use-trailing-return-type,-readability-function-cognitive-complexity,-readability-identifier-length,-readability-magic-numbers,-readability-named-parameter' ExtraArgs: ExtraArgsBefore: [] FormatStyle: none diff --git a/build_tools/clang_tidy.py b/build_tools/clang_tidy.py index 2c3645d087..b2ef72d9bb 100755 --- a/build_tools/clang_tidy.py +++ b/build_tools/clang_tidy.py @@ -60,7 +60,40 @@ def tidy_on_path(path): "clang-tidy", "-p0", "-path", BUILD_PATH, - "-checks=-cppcoreguidelines-pro-type-union-access,-llvm-include-order,-misc-definitions-in-headers,-modernize-use-trailing-return-type,-cppcoreguidelines-macro-usage,-modernize-replace-disallow-copy-and-assign-macro,-bugprone-macro-parentheses,-cppcoreguidelines-avoid-non-const-global-variables,-fuchsia-statically-constructed-objects,-fuchsia-overloaded-operator,-bugprone-easily-swappable-parameters,-cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-hicpp-named-parameter,-readability-named-parameter,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-readability-function-cognitive-complexity,-cert-err58-cpp,-cppcoreguidelines-avoid-c-arrays,-hicpp-avoid-c-arrays,-modernize-avoid-c-arrays,-cppcoreguidelines-owning-memory,-cppcoreguidelines-pro-type-const-cast,-concurrency-mt-unsafe,-readability-identifier-length,-fuchsia-default-arguments-calls,-google-readability-avoid-underscore-in-googletest-name,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-bugprone-lambda-function-name", + # Disable some checks that are not useful for us now. + # They are sorted by names, and should be consistent to .clang-tidy. + "-checks=-bugprone-easily-swappable-parameters," + "-bugprone-lambda-function-name," + "-bugprone-macro-parentheses," + "-cert-err58-cpp," + "-concurrency-mt-unsafe," + "-cppcoreguidelines-avoid-c-arrays," + "-cppcoreguidelines-avoid-magic-numbers," + "-cppcoreguidelines-avoid-non-const-global-variables," + "-cppcoreguidelines-macro-usage," + "-cppcoreguidelines-non-private-member-variables-in-classes," + "-cppcoreguidelines-owning-memory," + "-cppcoreguidelines-pro-bounds-array-to-pointer-decay," + "-cppcoreguidelines-pro-bounds-pointer-arithmetic," + "-cppcoreguidelines-pro-type-const-cast," + "-cppcoreguidelines-pro-type-union-access," + "-fuchsia-default-arguments-calls," + "-fuchsia-overloaded-operator," + "-fuchsia-statically-constructed-objects," + "-google-readability-avoid-underscore-in-googletest-name," + "-hicpp-avoid-c-arrays," + "-hicpp-named-parameter," + "-hicpp-no-array-decay," + "-llvm-include-order," + "-misc-definitions-in-headers," + "-misc-non-private-member-variables-in-classes," + "-modernize-avoid-c-arrays," + "-modernize-replace-disallow-copy-and-assign-macro," + "-modernize-use-trailing-return-type," + "-readability-function-cognitive-complexity," + "-readability-identifier-length," + "-readability-magic-numbers," + "-readability-named-parameter", "-extra-arg=-language=c++", "-extra-arg=-std=c++17", "-extra-arg=-Ithirdparty/output/include"]