Hi Elliotte,
On 29.11.2024 13:27, Elliotte Rusty Harold wrote:
We should do that too in our poms to avoid the recurring and annoying
problems of forgetting to run spotless manually and consequently
having a meaningless break in the CI that needs to be investigated.
Integrated over all of us this should save a few days of developer
time per year.
This can be done in a `pre-commit` Git Hook[1] installed locally. This
way the CI is not affected and still detects formatting failures.
Alternatively the CI could run `spotless:apply` and commit the result,
but this requires additional permissions for the workflow. IIRC
workflows triggered by `pull_request` can not write to the repository,
only those triggered by `pull_request_target` can.
Piotr
[1] https://git-scm.com/book/ms/v2/Customizing-Git-Git-Hooks
[2]
https://github.com/apache/logging-parent/blob/main/.github/workflows/merge-dependabot-reusable.yaml