Closed Freed-Wu closed 2 years ago
I don't quite follow the problem. Is that for a pre-commit hook you have set up on your local repo? Wouldn't you just use local gitignore if it's to go with a hook that's local only?
Hey, let me explain something:
pre-commit
will let
git commit
invoke vimdoc .
and generate doc/PLUGIN_NAME.txt
, which can
update document automatically.use local gitignore if it's to go with a hook that's local only?
I haven't ever understand why it is related to gitignore?
So you're saying each plugin repo would have vimdoc hooks to run vimdoc automatically for anyone with the pre-commit tool installed? But then just having vimdoc installed on the machine isn't enough to make it work, it needs to use vimdoc directly from the GitHub repo?
Like https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml , pre-commit will git clone this repo from GitHub and install it to a virtual env, then run the cmd of .pre-commit-hooks.yaml ,so it is needed.
Should it use the latest release tag instead of "master" then? And pre-commit runs on a developer machine, right? If so, is it intentional that it ignores any locally installed vimdoc?
Sorry, not trying to nitpick the approach here, I'm just stuck on why we need to configure something to tell it master is master and if that's really the ideal setup for what you're trying to hook up.
Should it use the latest release tag instead of "master" then?
Right
And pre-commit runs on a developer machine, right?
Right
If so, is it intentional that it ignores any locally installed vimdoc?
Right
not trying to nitpick the approach here
No serious. I can answer :smile:
Alright cool, I think I follow now! Thanks for your patience explaining to me. 😅 I'll go ahead and merge it.
I set this up to run vimdoc for the google/vim-maktaba repo in https://github.com/google/vim-maktaba/commit/88ad116. Works nicely! =)
According to https://pre-commit.com/#new-hooks, I write this hook and test it can work for me:
.pre-commit-config.yaml
I advice to publish a new version because
rev: master
is fragile and pre-commit will warn due to it.