CI(clang-format): Run faster and post fixes as code suggestions if possible when running on a PR #3483
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.
Replaces #3284
Closes #3284
This PR replaces #3284.
It is an adaptation of OSGeo/grass-addons#1038.
This integrates the ideas of #3284, which is to run clang-format way faster, in the 30-second range. It also sets the infrastructure needed to post code suggestions to the PRs of linter fixes. Clang-format is now the first here to have it. It is designed, and planned, to have some of our other tools add code suggestions as fixes to PRs to facilitate completing them and applying small fixes without a full round of feedback from the author.
Here is what I wrote for OSGeo/grass-addons#1038:
Examples (when intentionally creating formatting errors):

They can be batch committed as always by going to the files changed tab and adding the suggestions to a batch, and creating one commit.