-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[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
Conversation
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 |
@llvm/pr-subscribers-libcxx @llvm/pr-subscribers-github-workflow Author: Louis Dionne (ldionne) ChangesThe 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:
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
|
There was a problem hiding this 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.
418c947
to
5f7ab49
Compare
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
|
2d086d5
to
5f7ab49
Compare
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.