Skip to content

ci: run coding-guidelines on ubuntu-24.04 with clang-format-21 + reformat#4992

Open
matthargett wants to merge 2 commits into
bytecodealliance:mainfrom
rebeckerspecialties:ci/clang-format-21
Open

ci: run coding-guidelines on ubuntu-24.04 with clang-format-21 + reformat#4992
matthargett wants to merge 2 commits into
bytecodealliance:mainfrom
rebeckerspecialties:ci/clang-format-21

Conversation

@matthargett

@matthargett matthargett commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

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 wget fetches 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

  • Commit 1 (config): coding_guidelines.yml runs on ubuntu-24.04 and installs clang-format-21 from apt.llvm.org; coding_guidelines_check.py and the pre-commit sample pin clang-format-21 / git-clang-format-21. .clang-format's version note is updated (and its clang-formt typo fixed).
  • Commit 2 (reformat): mechanical 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-format needs no option changes. Standalone reformat commit for easy review.

Scope

Just clang-format. The clang-tidy bump to 21 + .clang-tidy curation is a separate follow-up: the wildcard config surfaces ~3,300 pre-existing diagnostics at 21 (dominated by misc-include-cleaner), so it needs re-tuning first — while keeping the bug-catching checks (e.g. bugprone-narrowing-conversions) enabled.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant