ci: run coding-guidelines on ubuntu-24.04 with clang-format-21 + reformat#4992
Open
matthargett wants to merge 2 commits into
Open
ci: run coding-guidelines on ubuntu-24.04 with clang-format-21 + reformat#4992matthargett wants to merge 2 commits into
matthargett wants to merge 2 commits into
Conversation
…4.04 Pins clang-format-21 / git-clang-format-21 in coding_guidelines_check.py and the pre-commit sample, installed from apt.llvm.org (a small ~50 MB package, not a full LLVM download). clang-format 21 matches the LLVM in Xcode 26/27, so contributors who build or auto-format on macOS/Xcode get the same result as CI - avoiding version-specific formatting surprises. Updates the .clang-format version note (and fixes its "clang-formt" typo). The tree is reformatted to clang-format-21 in the next commit.
Mechanical `clang-format-21 -i` (21.1.8, matching the apt.llvm.org package) over the coding-guidelines-checked sources. Standalone commit for easy review.
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the coding-guidelines gate to ubuntu-24.04 and bumps its formatter from clang-format-14 to clang-format-21, then reformats the tree to match. The clang-format slice of #4983.
Why clang-format-21
clang-format 21 matches the LLVM version shipped in Xcode 26 and 27. Pinning it means contributors who build or auto-format WAMR on macOS/Xcode produce the same result as CI and as contributors on other LLVM-built platforms — so nobody gets version-specific formatting surprises when clang-format's defaults shift between releases. It installs as a small (~50 MB) apt package from apt.llvm.org (the
wgetfetches only the ~2 KB signing key; the tool comes via apt), not a multi-GB LLVM toolchain download that previously exhausted disk space on runner images.What changed
coding_guidelines.ymlruns onubuntu-24.04and installs clang-format-21 from apt.llvm.org;coding_guidelines_check.pyand the pre-commit sample pin clang-format-21 / git-clang-format-21..clang-format's version note is updated (and itsclang-formttypo fixed).clang-format-21 -i(21.1.8, matching the apt.llvm.org package) over the coding-guidelines-checked sources.Noise: small
43 of 441 files (~230 lines) change — the code was already close to this style, and
.clang-formatneeds no option changes. Standalone reformat commit for easy review.Scope
Just clang-format. The clang-tidy bump to 21 +
.clang-tidycuration is a separate follow-up: the wildcard config surfaces ~3,300 pre-existing diagnostics at 21 (dominated bymisc-include-cleaner), so it needs re-tuning first — while keeping the bug-catching checks (e.g.bugprone-narrowing-conversions) enabled.