CI: Post pre-commit fixes as suggestions#6809
Conversation
In order to skip checks, prek was used instead of pre-commit
|
@wenzeslaus Would you mind taking a look at this in the following days? |
|
I still want this to unblock my other work to finish upgrading clang-format to the latest point release that fixes some bad parsing/formatting issues. Also want it before 8.5. |
wenzeslaus
left a comment
There was a problem hiding this comment.
More pre-commit replacing specific checks is good since we are using pre-commit anyway. A lot of changes, but they make sense.
BTW, CPython lint workflow us only a prek action.
|
I think they changed since I wrote the PR, I saw in some newer peek release notes the mention. I'll merge, and then tell me when you make this required and the clang-format not required @wenzeslaus |
|
Additional checks are now required, while Formatting check is not. Let me know if that works as expected. |
In order to simplify updating clang-format versions, I want to remove the clang-format workflow, and only use pre-commit for handling clang-format.
This means that the pre-commit run here should become a required check, and the clang-format workflow should not be a required check anymore. After merging this, these two changes should be made. cc @wenzeslaus
Until clang-format is removed, duplicate suggestions might be posted for clang-format fixes (one from clang-format workflow, and one from pre-commit). If you prefer, I can include the removal here, but the changes to the required checks must be done right before merging this (otherwise the existing and required clang-format check won't report a success).
To make this possible, I added a new tool source and new workflow source for posting PR suggestions. It is not intended to remove the older sources yet, as it allows un-updated PRs and branches to still have the suggestions posted.
I also needed to use prek instead of pre-commit (I've been using it since fall). https://github.com/j178/prek https://prek.j178.dev/ It is a rust equivalent of pre-commit, similar to ruff/uv, and installs way faster, and is faster in some tasks. It allows to skip hooks, rather than including hooks. That allows for removing running hooks that already post suggestions or handled in other workflows, collect the changed files for suggestions, and then run all pre-commit hooks without posting suggestions.
PR #6808 is intended to add fixes from an additional tool.
I also had to remove the created core_modules_with_last_commit.json file, as that changed file was creating problems when checking for changed files (to upload for suggestions). So, before deleting it, I uploaded it as an artifact.