Skip to content
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

Merged
merged 2 commits into from
Jun 28, 2024
Merged

Run clang-format in GitHub Actions #488

merged 2 commits into from
Jun 28, 2024

Conversation

GLinnik21
Copy link
Collaborator

No description provided.

@GLinnik21 GLinnik21 marked this pull request as draft May 21, 2024 22:15
@GLinnik21 GLinnik21 force-pushed the clang-format branch 2 times, most recently from 972a46e to a14718c Compare May 21, 2024 22:45
@GLinnik21 GLinnik21 marked this pull request as ready for review June 26, 2024 11:41
@GLinnik21 GLinnik21 requested a review from bamx23 June 26, 2024 11:41
.clang-format-ignore Show resolved Hide resolved
.github/workflows/clang-format.yml Show resolved Hide resolved
@GLinnik21 GLinnik21 force-pushed the clang-format branch 6 times, most recently from 0953264 to 640f09b Compare June 27, 2024 23:49
@GLinnik21
Copy link
Collaborator Author

Also, to keep git-blame clean, I think we should do this

@GLinnik21 GLinnik21 requested a review from bamx23 June 27, 2024 23:52
@bamx23
Copy link
Collaborator

bamx23 commented Jun 28, 2024

Also, to keep git-blame clean, I think we should do this

Yes, definitely. Didn't know about this

Sources/KSCrashBootTimeMonitor/KSCrashMonitor_BootTime.m Outdated Show resolved Hide resolved
Sources/KSCrashRecording/include/KSCrashMonitorType.h Outdated Show resolved Hide resolved
sudo apt-get install -y clang-format-18

- name: Define directories
run: echo "DIRS='Sources Tests Samples/Common/Sources/CrashTriggers' " >> $GITHUB_ENV
Copy link
Collaborator

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 Show resolved Hide resolved
- 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
Copy link
Collaborator

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)

Copy link
Collaborator Author

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

- name: Suggest formatting fixes
if: failure()
run: |
echo "Formatting issues found. Please run clang-format-18 on your code."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GLinnik21 GLinnik21 force-pushed the clang-format branch 11 times, most recently from 7b6d6d1 to 44fb0a9 Compare June 28, 2024 13:28
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
@GLinnik21 GLinnik21 merged commit ee8c47e into master Jun 28, 2024
26 checks passed
@GLinnik21 GLinnik21 deleted the clang-format branch June 28, 2024 14:07
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.

2 participants