Skip to content

[ci] Bump the version of clang-format used in the CI #119915

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 2 commits into from
Jan 7, 2025

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Dec 13, 2024

The version of clang-format we use in the CI to format all PRs is a bit outdated, leading to some confusion when the CI job produces different output from what people have locally.

We should decide on a policy for updating this version since it impacts the whole monorepo, and we should document the version currently in use somewhere (in the Contributing docs?). We should also decide on a policy for whether to re-apply clang-format to the whole codebase whenever we change this version.

@ldionne
Copy link
Member Author

ldionne commented Dec 13, 2024

This is a strawman, I mostly want to see what people think about this but I imagine we'll need to discuss on Discourse first.

CC @huixie90

@llvmbot
Copy link
Member

llvmbot commented Dec 13, 2024

@llvm/pr-subscribers-libcxx

@llvm/pr-subscribers-github-workflow

Author: Louis Dionne (ldionne)

Changes

The version of clang-format we use in the CI to format all PRs is a bit outdated, leading to some confusion when the CI job produces different output from what people have locally.

We should decide on a policy for updating this version since it impacts the whole monorepo, and we should document the version currently in use somewhere (in the Contributing docs?). We should also decide on a policy for whether to re-apply clang-format to the whole codebase whenever we change this version.


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

1 Files Affected:

  • (modified) .github/workflows/pr-code-format.yml (+1-1)
diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index f2bb37316d3a8b..5eb017737e853d 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -60,7 +60,7 @@ jobs:
       - name: Install clang-format
         uses: aminya/setup-cpp@v1
         with:
-          clangformat: 18.1.7
+          clangformat: 19.1.5
 
       - name: Setup Python env
         uses: actions/setup-python@v5

Copy link
Contributor

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

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

This seems reasonable enough to me.

There was discussion one of the first times we bumped this in #85502, and the consensus was we should just go with the latest release version for the formatting action.

Eventually I think we should do a monorepo-wide reformatting and figure out an official policy on this, but for now just using the latest release I think makes the most sense.

The version of clang-format we use in the CI to format all
PRs is a bit outdated, leading to some confusion when the
CI job produces different output from what people have locally.

We should decide on a policy for updating this version since
it impacts the whole monorepo, and we should document the version
currently in use somewhere (in the Contributing docs?). We should
also decide on a policy for whether to re-apply clang-format to
the whole codebase whenever we change this version.
@ldionne ldionne force-pushed the review/bump-clang-format branch from 418c947 to 5f7ab49 Compare January 7, 2025 17:55
@ldionne ldionne requested a review from a team as a code owner January 7, 2025 18:07
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff 292c1350d1509090949f037603663aa64985fe69 2d086d51b50de4572bdda003fc645145054bb317 --extensions h -- libcxx/include/__new/destroying_delete_t.h
View the diff from clang-format here.
diff --git a/libcxx/include/__new/destroying_delete_t.h b/libcxx/include/__new/destroying_delete_t.h
index 1596c71bcd..7fca4f6c68 100644
--- a/libcxx/include/__new/destroying_delete_t.h
+++ b/libcxx/include/__new/destroying_delete_t.h
@@ -21,8 +21,7 @@ namespace std {
 // Enable the declaration even if the compiler doesn't support the language
 // feature.
 struct destroying_delete_t {
-  explicit destroying_delete_t() =
-  default;
+  explicit destroying_delete_t() = default;
 };
 inline constexpr destroying_delete_t destroying_delete{};
 } // namespace std

@ldionne ldionne force-pushed the review/bump-clang-format branch from 2d086d5 to 5f7ab49 Compare January 7, 2025 21:39
@ldionne ldionne merged commit 858f025 into llvm:main Jan 7, 2025
9 checks passed
@ldionne ldionne deleted the review/bump-clang-format branch January 7, 2025 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github:workflow libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants