diff options
author | Nikolas Klauser <nikolasklauser@berlin.de> | 2025-05-15 10:34:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-15 10:34:09 +0200 |
commit | fbdf38ed4397e1d24c31a4bd79f7c6f55939f34f (patch) | |
tree | 82b738dce44f2ab7e84695eb08590dd7ff490314 /libcxx | |
parent | 947a52db7c88a6946e0d888851cc93faca6d726f (diff) | |
download | llvm-fbdf38ed4397e1d24c31a4bd79f7c6f55939f34f.zip llvm-fbdf38ed4397e1d24c31a4bd79f7c6f55939f34f.tar.gz llvm-fbdf38ed4397e1d24c31a4bd79f7c6f55939f34f.tar.bz2 |
[libc++] run clang-tidy on src/ in the CI (#121198)
This adds a new test to run clang-tidy on the `src/` directory and
temporarily disables and clang-tidy checks that currently fail. They
will be enabled in follow-up patches.
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/src/.clang-tidy | 16 | ||||
-rw-r--r-- | libcxx/test/configs/cmake-bridge.cfg.in | 1 | ||||
-rw-r--r-- | libcxx/test/libcxx/clang_tidy.sh.py | 11 | ||||
-rwxr-xr-x | libcxx/utils/ci/run-buildbot | 1 |
4 files changed, 28 insertions, 1 deletions
diff --git a/libcxx/src/.clang-tidy b/libcxx/src/.clang-tidy index ec8f2e0..3d5493d 100644 --- a/libcxx/src/.clang-tidy +++ b/libcxx/src/.clang-tidy @@ -1,4 +1,18 @@ InheritParentConfig: true Checks: > - -readability-identifier-naming + -clang-analyzer-*, + + -llvm-include-order, + + -modernize-loop-convert, + -modernize-use-equals-delete, + -modernize-use-nullptr, + -modernize-use-override, + + -readability-identifier-naming, + -readability-function-cognitive-complexity, + -readability-function-size, + -readability-simplify-boolean-expr, + +# TODO: Consider enabling clang-analyzer. Without the checks clang-tidy runs 18x faster on my system. diff --git a/libcxx/test/configs/cmake-bridge.cfg.in b/libcxx/test/configs/cmake-bridge.cfg.in index 61f821a..d7d5886 100644 --- a/libcxx/test/configs/cmake-bridge.cfg.in +++ b/libcxx/test/configs/cmake-bridge.cfg.in @@ -23,6 +23,7 @@ config.recursiveExpansionLimit = 10 config.test_exec_root = os.path.join('@LIBCXX_BINARY_DIR@', 'test') # Add substitutions for bootstrapping the test suite configuration +config.substitutions.append(('%{bin-dir}', '@LIBCXX_BINARY_DIR@')) config.substitutions.append(('%{libcxx-dir}', '@LIBCXX_SOURCE_DIR@')) config.substitutions.append(('%{install-prefix}', '@LIBCXX_TESTING_INSTALL_PREFIX@')) config.substitutions.append(('%{include-dir}', '@LIBCXX_TESTING_INSTALL_PREFIX@/@LIBCXX_INSTALL_INCLUDE_DIR@')) diff --git a/libcxx/test/libcxx/clang_tidy.sh.py b/libcxx/test/libcxx/clang_tidy.sh.py new file mode 100644 index 0000000..46f281f --- /dev/null +++ b/libcxx/test/libcxx/clang_tidy.sh.py @@ -0,0 +1,11 @@ +# ===----------------------------------------------------------------------===## +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# ===----------------------------------------------------------------------===## + +# REQUIRES: has-clang-tidy + +# RUN: %{python} %{libcxx-dir}/../clang-tools-extra/clang-tidy/tool/run-clang-tidy.py -clang-tidy-binary %{clang-tidy} -warnings-as-errors "*" -source-filter=".*libcxx/src.*" -quiet -p %{bin-dir}/.. diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot index 5c809fa..d8b23be 100755 --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -147,6 +147,7 @@ function generate-cmake() { generate-cmake-base \ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ -DLIBCXX_CXX_ABI=libcxxabi \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ "${@}" } |