CI: Add format check - #42
Conversation
d4af584 to
ac1ac07
Compare
3d9ff1b to
23f57af
Compare
afrind
left a comment
There was a problem hiding this comment.
Can we make format.sh a commit hook too?
@afrind reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on gmarzot).
michalhosna
left a comment
There was a problem hiding this comment.
Git commit hooks are local only (AFAIK).
We can commit something like .githooks/ (no special git meaning, just a normal folder), and everyone must locally set that as a hook folder git config core.hooksPath .githooks.
But then you cannot add your local Git hooks easily. There are tools that can manage that, and you can write a local wrapper to merge .githooks and your hooks.
Given that there is no fully automated out-of-the-box way. I would suggest everyone set their hooks; that's easy with the scripts we already provide:
ln -s ../../scripts/format.sh .git/hooks/pre-commit
Should I add that to a readme? (Do people read that?)
@michalhosna made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on gmarzot).
|
objection to "ci" it is too general (so was build and not complete) - i spent some time on picking descriptive names for workflow files, actions and job names. check out the latest and we can discuss |
|
lgtm |
|
Previously, gmarzot (Giovanni Marzot) wrote…
Still there. In moxygen we renamed the file ( |
|
Previously, gmarzot (Giovanni Marzot) wrote…
hoping we can follow the pattern from moxygen |
23f57af to
dc8b6c7
Compare
d084c6c to
6e28717
Compare
Add --check flag to scripts/format.sh rather than calling clang-format directly in ci.yml, so the set of matched files stays consistent between local formatting and CI verification. Replace rg with find in the script to avoid requiring ripgrep in CI. The format job runs in a debian:trixie container to pin clang-format 19. The script checks the version at startup so local dev catches mismatches early. Version 19 is not a particularly specific choice — it ships in Debian stable, Homebrew, and EPEL, so it is widely available. It is recent enough to support the style options we use but not the newest release.
5e9bd64 to
7d2703f
Compare
michalhosna
left a comment
There was a problem hiding this comment.
@michalhosna made 2 comments, resolved 1 discussion, and dismissed @gmarzot from a discussion.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on afrind and gmarzot).
.github/workflows/ci.yml line 1 at r1 (raw file):
Reverted.
Still there.
We yeah, I didn't say its fixed between your two comments. Not sure where the confusion is coming from. Did I do something wrong?
a discussion (no related file):
Okay, clang-format breaks stuff with every version :(. So we need to fix on one.
I didn't go with what's in ubuntu-22, as that's fairly old and not supporting stuff we currently have in .clang-format. I also didn't really want to go with cutting-edge if it isn't easily avaible somewhere. 19. seems like a helthy middle ground.
afrind
left a comment
There was a problem hiding this comment.
Sure, just tell me and my agent what to do
@afrind reviewed 3 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on gmarzot).
|
Previously, michalhosna (Michal Hošna) wrote…
no just over explaining |
gmarzot
left a comment
There was a problem hiding this comment.
@gmarzot reviewed 3 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on michalhosna).
Add --check flag to scripts/format.sh rather than calling clang-format
directly in ci.yml, so the set of matched files stays consistent between
local formatting and CI verification.
Replace rg with find in the script to avoid requiring ripgrep in CI.
Rename workflow from "build" to "ci" to match the filename and reflect
that it now covers more than building.
The format job uses ubuntu-24.04 (unlike the build jobs) to get a
reasonably modern clang-format, even though we target older compilers
for building.
This change is