[clang-tools-extra] [llvm] [Github][CI] Don't build analysis targets when no relevant projects present (PR #196882)

Baranov Victor via llvm-commits llvm-commits at lists.llvm.org
Sun May 10 23:16:59 PDT 2026


https://github.com/vbvictor updated https://github.com/llvm/llvm-project/pull/196882

>From fd08aec94e7ebe30c65f2fc0df5d1d5d513f4f62 Mon Sep 17 00:00:00 2001
From: Victor Baranov <bar.victor.2002 at gmail.com>
Date: Mon, 11 May 2026 08:59:58 +0300
Subject: [PATCH 1/2] [Github][CI] Don't build analysis targets when no
 relevant projects are present

---
 .github/workflows/pr-code-lint.yml | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml
index 829a1ec5b94ca..5101db3ca7612 100644
--- a/.github/workflows/pr-code-lint.yml
+++ b/.github/workflows/pr-code-lint.yml
@@ -74,9 +74,16 @@ jobs:
                 -DCLANG_INCLUDE_TESTS=OFF \
                 -DCMAKE_BUILD_TYPE=Release
 
-          ninja -C build \
-                clang-tablegen-targets \
-                genconfusable               # for "ConfusableIdentifierCheck.h"
+          ninja_targets=""
+          if [[ ";${projects_to_build};" == *";clang;"* ]]; then
+            ninja_targets="${ninja_targets} clang-tablegen-targets"
+          fi
+          if [[ ";${projects_to_build};" == *";clang-tools-extra;"* ]]; then
+            ninja_targets="${ninja_targets} genconfusable"
+          fi
+          if [[ -n "${ninja_targets}" ]]; then
+            ninja -C build ${ninja_targets}
+          fi
 
       - name: Run code linters
         env:

>From c240a698dae61cffa1817ccb8ff141d51dfecdb9 Mon Sep 17 00:00:00 2001
From: Victor Baranov <bar.victor.2002 at gmail.com>
Date: Mon, 11 May 2026 09:16:23 +0300
Subject: [PATCH 2/2] test 2

---
 clang-tools-extra/clang-tidy/ClangTidy.cpp                    | 4 ++--
 .../checks/llvmlibc/implementation-in-namespace.rst           | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index 05c8fd02fe86a..242520492f401 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -99,12 +99,12 @@ class AnalyzerDiagnosticConsumer : public ento::PathDiagnosticConsumer {
 
 class ErrorReporter {
 public:
-  ErrorReporter(ClangTidyContext &Context, FixBehaviour ApplyFixes,
+  ErrorReporter(ClangTidyContext &Context, FixBehaviour applyFixes,
                 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> BaseFS)
       : Files(FileSystemOptions(), std::move(BaseFS)),
         DiagPrinter(new TextDiagnosticPrinter(llvm::outs(), DiagOpts)),
         Diags(DiagnosticIDs::create(), DiagOpts, DiagPrinter),
-        SourceMgr(Diags, Files), Context(Context), ApplyFixes(ApplyFixes) {
+        SourceMgr(Diags, Files), Context(Context), ApplyFixes(applyFixes) {
     DiagOpts.ShowColors = Context.getOptions().UseColor.value_or(
         llvm::sys::Process::StandardOutHasColors());
     DiagPrinter->BeginSourceFile(LangOpts);
diff --git a/clang-tools-extra/docs/clang-tidy/checks/llvmlibc/implementation-in-namespace.rst b/clang-tools-extra/docs/clang-tidy/checks/llvmlibc/implementation-in-namespace.rst
index a00e476e06438..84774881fbbcc 100644
--- a/clang-tools-extra/docs/clang-tidy/checks/llvmlibc/implementation-in-namespace.rst
+++ b/clang-tools-extra/docs/clang-tidy/checks/llvmlibc/implementation-in-namespace.rst
@@ -10,7 +10,7 @@ correct namespace.
 
     // Implementation inside the LIBC_NAMESPACE_DECL namespace.
     // Correct if:
-    // - LIBC_NAMESPACE_DECL is a macro
+    // Some change - LIBC_NAMESPACE_DECL is a macro
     // - LIBC_NAMESPACE_DECL expansion starts with `[[gnu::visibility("hidden")]] __llvm_libc`
     namespace LIBC_NAMESPACE_DECL {
         LLVM_LIBC_FUNCTION(char *, strcpy, (char *dest, const char *src)) {}



More information about the llvm-commits mailing list