add git pre push hook by lazer-dev · Pull Request #2553 · diffplug/spotless
If I read the code correctly, spotlessInstallGitPrePushHook will only run if you explicitly call it - it's not a dependency of check or anything like that. Am I correct?
Yes, that's correct — if you want this feature, you have to manually run the spotlessInstallGitPrePushHook command once.
to me, that is "disabled by default" enough. If someone really wants it they can add it as a dependency of check or whatever.
Yes, it's disabled by default — you're right. If someone wants it to run automatically, they can add it as a dependency to check, but I don't think we need to provide that functionality out of the box.
pre-commit hook has some problems (and a solution) outlined in #623
Yes, that's true. I'm not entirely sure the proposed solution works 100% reliably. In any case, that situation with pre-push happens quite rare, and I believe the shell script should stay as simple as possible. The edge case described in that issue doesn’t happen often enough to justify a more complex script that might introduce new bugs.
i prefer to have fewer config options, if someone needs it so much they're willing to write the PR and docs for it then
Hmm, if you really want this option, I’m happy to implement it. But just to consider — in 99.9999% of cases when spotlessCheck fails, the user will immediately run spotlessApply. Only in very rare cases does apply not fix everything and require manual edits. So in my opinion, the benefit of making this configurable is questionable. But again — if you want it, I’m happy to add it :)
This still needs docs in the README.md for each plugin.
Got it — could you please clarify what exactly is missing? Do you expect a short description of the hook task/goal, or also an example usage? Just want to make sure I include everything needed.