Run clang-format inside a pinned docker image#3472
Conversation
Update the Makefile clang-format target to invoke clang-format inside a Docker image pinned in dependencies.Dockerfile so the tool runs at a consistent version (matching the clang-format-19 used in CI) for every contributor. Resolves open-telemetry#2774
c4dcebc to
b81d1a2
Compare
MrAlias
left a comment
There was a problem hiding this comment.
This looks like a useful improvement. Moving make clang-format to a pinned Docker image makes that workflow more reproducible and removes one source of local version drift.
One thing I’d want to call out is scope: this change standardizes the make clang-format path, but it doesn’t yet bring the other formatter entry points onto the same toolchain. The CI check still installs and runs clang-format-19 directly, and the pre-commit hook still calls the host clang-format, so we can still get different behavior depending on how formatting is run.
I don’t think that blocks this PR if the goal here is specifically to fix the Makefile workflow. But I do think it would help to leave a note about expected follow-up, so readers don’t assume this change fully unifies formatting across local development and CI.
Extend the dockerized clang-format setup to the clang-format-check CI workflow and the local pre-commit hook so all three entry points use the image pinned in dependencies.Dockerfile.
Hi, will extend the scope of this to the ci and the pre-commit hook |
|
hi @MrAlias extended the PR to dockerize the remaining two entry points so all three (
Updated the CHANGELOG entry to reflect the broader scope. Verified locally:
|
|
hi @MrAlias do you have any review here yet for this? |
Update the Makefile clang-format target to invoke clang-format inside a Docker image pinned in dependencies.Dockerfile
Resolves #2774