Closed yarnabrina closed 2 years ago
Thanks for bringing this to our attention? Would you care to make a pull request for one or both solutions you suggest?
Copying my comment from the PR:
I read up on this issue again and found the reason why things are configured the way they are: with pass_filenames: true pre-commit will only check modified files and therefore produce many false positives (see https://github.com/jendrikseipp/vulture/pull/244). While researching this, I found pre-commit run --all-files
but I think the current solution of requiring the user to specify the files leads to better results.
I don't see a better solution than the status quo, so I'm closing this PR. But we can definitely reopen it when we find a better solution.
I tried to use
vulture
as part of our.pre-commmit-config.yaml
file. I added the following snippet directly as documented in README:It failed with the following error:
While I fixed it by passing
.
as an argument inargs
section or by usingpass_filenames: true
, I feel this is a general enough to be included as part of the hook definition. Can you please change this?https://github.com/jendrikseipp/vulture/blob/master/.pre-commit-hooks.yaml#L7
Or, if there are any issues with that, is it possible to at least update the documentation with a working snippet? I think that will be very helpful for other users.