[clang-tools-extra] [llvm] [GitHub] Bump clang-tidy version to 21th in CI (PR #160193)

Baranov Victor via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 23 14:06:52 PDT 2025


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

>From e78a08ba18618ad8b1bc4e0a7203fc311d8fb75e Mon Sep 17 00:00:00 2001
From: Baranov Victor <bar.victor.2002 at gmail.com>
Date: Mon, 22 Sep 2025 23:22:19 +0300
Subject: [PATCH 1/5] WIP

---
 .github/workflows/pr-code-lint.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml
index bc70933147bd2..3efd75471a317 100644
--- a/.github/workflows/pr-code-lint.yml
+++ b/.github/workflows/pr-code-lint.yml
@@ -47,10 +47,13 @@ jobs:
           echo "Changed files:"
           echo "$CHANGED_FILES"
 
+      # The clang tidy version should always be upgraded to the first version
+      # of a release cycle (x.1.0) or the last version of a release cycle, or
+      # if there have been relevant clang-format backports.
       - name: Install clang-tidy
         uses: aminya/setup-cpp at 17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
         with:
-          clang-tidy: 20.1.8
+          clang-tidy: 21.1.0
       
       - name: Setup Python env
         uses: actions/setup-python at 42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0

>From d7afc695fd4bd983f4e693dde6b58e567d7e025d Mon Sep 17 00:00:00 2001
From: Victor Baranov <bar.victor.2002 at gmail.com>
Date: Tue, 23 Sep 2025 23:44:28 +0300
Subject: [PATCH 2/5] add ccache

---
 .github/workflows/pr-code-lint.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml
index 3efd75471a317..89ee6b116d2f4 100644
--- a/.github/workflows/pr-code-lint.yml
+++ b/.github/workflows/pr-code-lint.yml
@@ -62,6 +62,11 @@ jobs:
 
       - name: Install Python dependencies
         run: python3 -m pip install -r llvm/utils/git/requirements_linting.txt
+
+      - name: Setup ccache
+        uses: hendrikmuhs/ccache-action at a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
+        with:
+          max-size: "2000M"
       
       # TODO: create special mapping for 'codegen' targets, for now build predefined set
       # TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies

>From 3e7982527f9766a9a1a362ce28ee7ad3bdd73ec1 Mon Sep 17 00:00:00 2001
From: Victor Baranov <bar.victor.2002 at gmail.com>
Date: Tue, 23 Sep 2025 23:49:29 +0300
Subject: [PATCH 3/5] wip

---
 .github/workflows/pr-code-lint.yml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml
index 89ee6b116d2f4..6ae9559772019 100644
--- a/.github/workflows/pr-code-lint.yml
+++ b/.github/workflows/pr-code-lint.yml
@@ -19,8 +19,6 @@ jobs:
     defaults:
       run:
         shell: bash
-    container:
-      image: 'ghcr.io/llvm/ci-ubuntu-24.04:latest'
     timeout-minutes: 60
     concurrency:
       group: ${{ github.workflow }}-${{ github.ref }}

>From 4212d1849971081abb8042ffb4837776a3b46c2c Mon Sep 17 00:00:00 2001
From: Victor Baranov <bar.victor.2002 at gmail.com>
Date: Tue, 23 Sep 2025 23:54:03 +0300
Subject: [PATCH 4/5] broke style

---
 clang-tools-extra/clang-tidy/ClangTidy.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index 7e18f3806a143..d81c4cd0e0a84 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -182,7 +182,7 @@ class ErrorReporter {
           }
         }
       }
-      reportFix(Diag, Error.Message.Fix);
+      ReportFix(Diag, Error.Message.Fix);
     }
     for (auto Fix : FixLocations) {
       Diags.Report(Fix.first, Fix.second ? diag::note_fixit_applied
@@ -266,7 +266,7 @@ class ErrorReporter {
     return SourceMgr.getLocForStartOfFile(ID).getLocWithOffset(Offset);
   }
 
-  void reportFix(const DiagnosticBuilder &Diag,
+  void ReportFix(const DiagnosticBuilder &Diag,
                  const llvm::StringMap<Replacements> &Fix) {
     for (const auto &FileAndReplacements : Fix) {
       for (const auto &Repl : FileAndReplacements.second) {
@@ -290,7 +290,7 @@ class ErrorReporter {
         << Message.Message;
     for (const FileByteRange &FBR : Message.Ranges)
       Diag << getRange(FBR);
-    reportFix(Diag, Message.Fix);
+    ReportFix(Diag, Message.Fix);
   }
 
   CharSourceRange getRange(const FileByteRange &Range) {

>From 16314c218bb50316ebc7596cd2d81c0378452310 Mon Sep 17 00:00:00 2001
From: Victor Baranov <bar.victor.2002 at gmail.com>
Date: Wed, 24 Sep 2025 00:06:37 +0300
Subject: [PATCH 5/5] add sccache

---
 .github/workflows/pr-code-lint.yml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/pr-code-lint.yml b/.github/workflows/pr-code-lint.yml
index 6ae9559772019..1cdf77c8185ff 100644
--- a/.github/workflows/pr-code-lint.yml
+++ b/.github/workflows/pr-code-lint.yml
@@ -64,7 +64,9 @@ jobs:
       - name: Setup ccache
         uses: hendrikmuhs/ccache-action at a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
         with:
-          max-size: "2000M"
+          max-size: 2G
+          key: post-commit-analyzer
+          variant: sccache
       
       # TODO: create special mapping for 'codegen' targets, for now build predefined set
       # TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies



More information about the llvm-commits mailing list