Skip to content

[libc++] Re-enable Clang-tidy checks in the CI #110026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 25, 2024

Now that we've gained control of our CI docker image again,
we can re-enable the clang-tidy tests.

@ldionne ldionne requested a review from a team as a code owner September 25, 2024 18:55
@ldionne
Copy link
Member Author

ldionne commented Sep 25, 2024

This requires #99819 to be fixed, IIUC.

@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Sep 25, 2024
@llvmbot
Copy link
Member

llvmbot commented Sep 25, 2024

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/110026.diff

1 Files Affected:

  • (modified) libcxx/test/tools/clang_tidy_checks/CMakeLists.txt (-3)
diff --git a/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt b/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
index 0e1d3506a99735..92e1a2b4553c84 100644
--- a/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
+++ b/libcxx/test/tools/clang_tidy_checks/CMakeLists.txt
@@ -1,6 +1,3 @@
-# TODO: Re-enable the tests once the CI is back under control
-return()
-
 # The find_package changes these variables. This leaves the build in an odd
 # state. Calling cmake a second time tries to write site config information in
 # the system's libc++. Restoring these setting after testing fixes this issue.

@ldionne ldionne force-pushed the review/reenable-clang-tidy-checks branch from bdbde1a to 8afe133 Compare November 19, 2024 23:42
@ldionne ldionne force-pushed the review/reenable-clang-tidy-checks branch from f67c0b0 to 191a05b Compare November 29, 2024 20:03
Copy link

github-actions bot commented Nov 29, 2024

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r 820403c4e04db1f4adc8528bec33d393a5be3856...6cb289b45a630f37bdbdb9ef59d3961fb572237b libcxx/test/libcxx/clang_tidy.gen.py
View the diff from darker here.
--- clang_tidy.gen.py	2024-11-29 20:03:37.000000 +0000
+++ clang_tidy.gen.py	2024-11-29 21:52:11.090798 +0000
@@ -13,14 +13,19 @@
 # block Lit from interpreting a RUN/XFAIL/etc inside the generation script
 # END.
 
 import sys
 sys.path.append(sys.argv[1])
-from libcxx.header_information import lit_header_restrictions, lit_header_undeprecations, public_headers
+from libcxx.header_information import (
+    lit_header_restrictions,
+    lit_header_undeprecations,
+    public_headers,
+)
 
 for header in public_headers:
-  print(f"""\
+    print(
+        f"""\
 //--- {header}.sh.cpp
 
 // REQUIRES: has-clang-tidy
 
 // The GCC compiler flags are not always compatible with clang-tidy.
@@ -35,6 +40,7 @@
 // TODO: run clang-tidy with modules enabled once they are supported
 // RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --checks='-*,libcpp-*' --load=%{{test-tools-dir}}/clang_tidy_checks/libcxx-tidy.plugin -- %{{compile_flags}} -fno-modules
 // RUN: %{{clang-tidy}} %s --warnings-as-errors=* -header-filter=.* --config-file=%{{libcxx-dir}}/.clang-tidy -- -Wweak-vtables %{{compile_flags}} -fno-modules
 
 #include <{header}>
-""")
+"""
+    )

Copy link

github-actions bot commented Nov 29, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@@ -998,7 +998,6 @@ constexpr chrono::year operator ""y(unsigned lo
# include <cstdint>
# include <stdexcept>
# include <string_view>
# include <vector>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this have to be removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It triggers a duplicate include warning with the one in the _LIBCPP_STD_VER <= 20 block below.

@ldionne ldionne merged commit 3d43789 into llvm:main Dec 2, 2024
58 of 62 checks passed
@ldionne ldionne deleted the review/reenable-clang-tidy-checks branch December 2, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants