-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[TEST][WIP] Run clang-format inside ci-container #160193
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
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-github-workflow Author: Baranov Victor (vbvictor) ChangesWIP, do not review Full diff: https://github.com/llvm/llvm-project/pull/160193.diff 1 Files Affected:
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@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
with:
- clang-tidy: 20.1.8
+ clang-tidy: 21.1.0
- name: Setup Python env
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
|
✅ With the latest revision this PR passed the C/C++ code linter. |
c5f8ae9
to
aeeb181
Compare
You can test this locally with the following command:git-clang-format --diff origin/main HEAD --extensions cpp -- clang-tools-extra/clang-tidy/ClangTidy.cpp
View the diff from clang-format here.diff --git a/clang-tools-extra/clang-tidy/ClangTidy.cpp b/clang-tools-extra/clang-tidy/ClangTidy.cpp
index 385c7adc6..7e18f3806 100644
--- a/clang-tools-extra/clang-tidy/ClangTidy.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidy.cpp
@@ -270,7 +270,8 @@ private:
const llvm::StringMap<Replacements> &Fix) {
for (const auto &FileAndReplacements : Fix) {
for (const auto &Repl : FileAndReplacements.second) {
- if (!Repl.isApplicable()) continue;
+ if (!Repl.isApplicable())
+ continue;
FileByteRange FBR;
FBR.FilePath = Repl.getFilePath().str();
FBR.FileOffset = Repl.getOffset();
|
182ca8e
to
1ce93d7
Compare
You can test this locally with the following command:darker --check --diff -r origin/main...HEAD llvm/utils/git/code-lint-helper.py
View the diff from darker here.--- code-lint-helper.py 2025-09-28 11:26:33.000000 +0000
+++ code-lint-helper.py 2025-09-28 11:28:31.390526 +0000
@@ -204,12 +204,14 @@
print(f"Running clang-tidy-diff: {' '.join(tidy_diff_cmd)}")
proc = subprocess.run(
tidy_diff_cmd,
input=diff_content,
- stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- text=True, check=False,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ text=True,
+ check=False,
)
return clean_clang_tidy_output(proc.stdout.strip())
|
This is just a duplicate of #161073? |
Yes, I'm testing how everything works here |
Testing ground do not review!