With the upcoming Spotless version 2.46.0 (see #2509), Spotless offers a Git hook out of the box (see diffplug/spotless#2553).
We could replace our own custom hook with the spotless one to streamline contributing for external developers.
The Spotless hook works on a pre-push basis (while ours is a pre-commit hook). It can be installed with spotless:install-git-pre-push-hook. It works as follows:
- Runs spotlessCheck
- If issues are found:
- It runs spotlessApply automatically
- Prints a message: "Spotless found problems, running apply; commit the result and re-push"
- Aborts the push with exit code 1
With the upcoming Spotless version 2.46.0 (see #2509), Spotless offers a Git hook out of the box (see diffplug/spotless#2553).
We could replace our own custom hook with the spotless one to streamline contributing for external developers.
The Spotless hook works on a pre-push basis (while ours is a pre-commit hook). It can be installed with
spotless:install-git-pre-push-hook. It works as follows: