ci: Add clang-format lint check #1510
Open
+39
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checks formatting and lints for PR changes in CI, using this github action: https://github.com/marketplace/actions/c-c-linter
I left the default clang-tidy checks enabled, if this is undesirable they can be set to read from a .clang-tidy file, although there isn't one in the repo currently.
I've also set it to comment on the pull request thread with the results, so that they are more visible. However, this does introduce noise to the PR thread so I'm open to disabling it. In either case, it will comment on the most recent commit with the results.
Unfortunately there aren't many actions available to run clang-format on only the files changed in a PR from what I can find, and this one does not indicate the exact formatting errors that are found (only that the files are not formatted correctly).
A dummy PR with failing lints is available here: antangelo#3