Keep in mind pre-commit tool != git-hooks, is like confusing JavaScript with Java ;)
By default pre-commit does not install any hooks. Yes, you can install them, but in 9/10 cases I don't, I only have an alias pc="pre-commit run -a" which I run before each git-review. In fact I was considering adding an optional feature to git-review to auto run this when the repository has a .pre-commit-config.yml file.
I am glad someone else opened the pre-commit subject before me. While it comes with its own challenges (git cloning), pre-commit resolves the problem of having predictable linter results by pinning them. Also it enables vey easy bumping of all of them.
AFAIK, over the last year I removed hacking from several projects and replaced it with pre-commit and I am much happier.
Not sure if others know but both bashate and doc8 can be used from pre-commit too.
Extra bonus: we can avoid the case where we end-up having tons of jobs performing linting or style checks. we need to keep the jobs even if we use pre-commit becasue it is optional to run it and we have to comply with teh PTI rules but addtional linters could be run via a singe pre-comite job.
On Fri, 2019-11-22 at 13:51 +0000, Sorin Sbarnea wrote: there is a patch to add precommit support to nova https://review.opendev.org/#/c/665518/ as an optional thing people can use if they choose too but that has been pending for 3 months at this point.
On 22 Nov 2019, at 13:11, Sean Mooney <smooney@redhat.com> wrote:
On Thu, 2019-11-21 at 15:32 -0800, Dan Smith wrote:
nova only has a couple but it might be intersting to convert those to precommit scripts. looking through them some of them do seam useful although other are just python 2 vs python 3 guidline that i hope will be less relevant now.
I would so very much love if we did NOT do that. Precommit hooks are super annoying for writing up quick PoCs and DNM patches, which we do a lot.
ya true although i was referign to the precommit framework which we previously disucssed and said shoudl be optional to install. do you think we should keep/maintain hacking in nova and or port these to something else if not? anyway it was just a thought i dont want it to be mandaroy on every commit for the poc hacking reason either but it might be a way to keep the checks without having to contiue to maintain hacking.
--Dan