Repository navigation
Conversation
The format gate accepted whatever clang-format was installed, so the tree could pass on one machine and fail on another. Pin it to major version 20, enforced on any binary named through CLANG_FORMAT, and fail with exit 2 when git or diff errors instead of passing. Add a commentflow gate, modeled on the one in elfuse. clang-format never refills a short-wrapped comment, so comment width was the one part of the style no check settled. Reflow the existing comments to the 80-column limit once; adjacent comments the tool would have merged are written as one comment with a blank line between paragraphs. The workflow now installs both tools, bumps actions/checkout to v7, runs on ubuntu-24.04, drops default token permissions to read, and cancels superseded pull request runs. Dependabot watches the actions.
Iterate the git file list NUL-delimited through a temporary file so a failing git is still an error and odd filenames stay one path, skip tracked files deleted from the worktree, and pin clang-format to 20.1.8 so the formatter cannot move under an unchanged commit.
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.
CI accepted any clang-format version and had no check on comment width, so formatting depended on who ran it. This pins clang-format to major version 20 and adds a commentflow gate (modeled on elfuse) that reflows comments to the column limit read from .clang-format. The existing comments were reflowed once; where the tool merged adjacent comments that were separate on purpose, I rewrote them as one comment with a blank line between paragraphs. The workflow also moves to actions/checkout@v7 on ubuntu-24.04, drops token permissions to read, cancels superseded PR runs, and adds a Dependabot config for the actions.
Left as is: commentflow is installed from its rolling latest release with the sha256 GitHub records for the asset, because upstream publishes no other tag. A new commentflow release can therefore change the reflow rules under an unchanged commit.
Summary by cubic
Pins CI to clang-format 20 and adds a commentflow gate so formatting and comment width no longer depend on which machine ran the checks.
20.1.8so the formatter cannot drift under an unchanged commit; git or diff failures are errors, not passes..clang-format, and reflows the existing comments once; comments the tool would merge are written as one comment with a blank line between paragraphs.actions/checkout@v7on ubuntu-24.04, limits token permissions to read, cancels superseded pull request runs, and adds Dependabot for the actions.commentflowis installed from its rolling latest release with the sha256 taken from the GitHub API, so a new release could change the reflow rules without a commit change.Written for commit c0f5f66. Summary will update on new commits.