-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run clang-format in GitHub Actions #488
Conversation
972a46e
to
a14718c
Compare
Sources/KSCrashRecording/Monitors/KSCrashMonitor_MachException.c
Outdated
Show resolved
Hide resolved
0953264
to
640f09b
Compare
Also, to keep git-blame clean, I think we should do this |
Yes, definitely. Didn't know about this |
.github/workflows/clang-format.yml
Outdated
sudo apt-get install -y clang-format-18 | ||
|
||
- name: Define directories | ||
run: echo "DIRS='Sources Tests Samples/Common/Sources/CrashTriggers' " >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember that it's poossible to specify env for a job here in the spec and not in runtime
.github/workflows/clang-format.yml
Outdated
- name: Check formatting | ||
run: | | ||
find $DIRS -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.m' | \ | ||
xargs -r clang-format-18 -style=file -n -Werror |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, maybe it's better to add back a Makefile
with this? Or a script. As otherwise it might not be easy for contributors to fix formatting without applying the patch from PR (I would prefer to fix format before I submit changes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it in another PR
.github/workflows/clang-format.yml
Outdated
- name: Suggest formatting fixes | ||
if: failure() | ||
run: | | ||
echo "Formatting issues found. Please run clang-format-18 on your code." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7b6d6d1
to
44fb0a9
Compare
Add `.clang-format-ignore` Use LLVM in format Populate `.clang-format-ignore` add `Samples/Common/Sources/CrashTriggers` to trigggers Add subdirectories in ignore Run only for trigger paths
No description provided.