-
Notifications
You must be signed in to change notification settings - Fork 5
add format script #11
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
Conversation
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.
Thanks for pulling this together! I was wonder if we just use this action: https://github.com/marketplace/actions/clang-format-check#multiple-paths in the tests.yml
.
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Test format | ||
run: | | ||
./scripts/cl-fmt.sh | ||
git diff --exit-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.
What if we used the clang format action? This would allow us to drop the script and pull the action.
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test format | |
run: | | |
./scripts/cl-fmt.sh | |
git diff --exit-code | |
format-check: | |
name: Format checks | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
path: | |
- 'src' | |
- 'test' | |
- 'include' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Test format | |
uses: jidicula/clang-format-action@v4 | |
with: | |
clang-format-version: '15' |
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.
yes this is possible, the benefit of the script is that it can be run locally, so if you would like to format your code, just execute the script. But if you like we can also use the action.
I would first prefer to fix the codebase and then adding this.
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.
That makes sense. We can keep the script then. I was seeing your action file was using it and running the diff. Wasn't actually formatting then committing and a color diff would have been nice. I stumbled across this and figured it made more sense to do this and run the format on it one time locally like you said.
If you want I can run it and merge or you can do that within this one. Whatever works best for the work you are doing let me know.
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 would like to first merge the other two branches, because otherwise a merge gets really a mess. So this is on hold for now
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.
okay that is what I figured you wanted. Adding a TODO after that.
- Format code with clang format here
Closing this one since #15 replaces this one. |
No description provided.