Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pass_filenames: false from pre-commit hook #376

Closed
wants to merge 2 commits into from

Conversation

cbachhuber
Copy link

To make the vulture pre-commit hook work on the specific files specified by pre-commit and not on the entire repo, I need to override the config it as shown here, with pass_filenames: true. I argue that this is a saner default than pass_filenames: false, so let's remove it from vulture's pre-commit hook.

Related Issue

luminartech/dev-tools#43

Checklist:

  • I have updated the documentation in the README.md file or my changes don't require an update.
  • I have added an entry in CHANGELOG.md.
  • I have added or adapted tests to cover my changes.
  • I have run pre-commit run --all-files to format and lint my code.

@jendrikseipp
Copy link
Owner

Thanks for the PR, but --pass-filenames: true incurs that pre-commit only passes the changed files to Vulture. Vulture needs all project files to work correctly, though. (Otherwise, it will miss a lot of unused code or falsely report code as unused.)

@cbachhuber
Copy link
Author

That makes sense, thanks for explaining! How about adding an explanatory comment to this config line? Something like

--pass-filenames: false # vulture needs access to all files for a complete analysis

Btw, in our private repo, we're using --pass-filenames: true because it's a large legacy codebase and we haven't rolled out vulture completely yet. Together with min_confidence = 100, it works just fine. With this setup, the value of vulture is very limited, of course.

@jendrikseipp
Copy link
Owner

Good idea about the comment. Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants