Skip to content

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

Closed
wants to merge 2 commits into from
Closed

add format script #11

wants to merge 2 commits into from

Conversation

Murmele
Copy link
Contributor

@Murmele Murmele commented Jan 7, 2023

No description provided.

@Murmele Murmele marked this pull request as draft January 7, 2023 17:56
@Murmele Murmele marked this pull request as ready for review January 7, 2023 17:57
@Murmele Murmele marked this pull request as draft January 7, 2023 18:14
Copy link
Owner

@LinuxDevon LinuxDevon left a 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.

Comment on lines +30 to 38
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test format
run: |
./scripts/cl-fmt.sh
git diff --exit-code

Copy link
Owner

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.

Suggested change
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'

Copy link
Contributor Author

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.

Copy link
Owner

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.

Copy link
Contributor Author

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

Copy link
Owner

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

@LinuxDevon LinuxDevon mentioned this pull request Feb 10, 2023
@LinuxDevon
Copy link
Owner

Closing this one since #15 replaces this one.

@LinuxDevon LinuxDevon closed this Feb 10, 2023
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