-
Notifications
You must be signed in to change notification settings - Fork 371
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
support pre-commit #60
Labels
Comments
@andrewpollock I think you had thoughts on this before right? |
Yep, pointed you at my previous thoughts off-issue. |
hayleycd
pushed a commit
that referenced
this issue
Dec 1, 2023
This change exposes a pre-commit hook for people to use that would run osv-scanner when commiting code to their codebase. Resolves #60. I manually tested this change by modifying the `.pre-commit-config.yaml` file from the [pipdeptree](https://github.com/tox-dev/pipdeptree) project to the following: ```yml repos: - repo: https://github.com/kemzeb/osv-scanner rev: 321d06b hooks: - id: osv-scanner args: ["-r", "."] ``` ...where I ran pre-commit locally by doing the following: Install the pre-commit script: ```console pre-commit install ``` Run while using all the files in the pipdeptree repo, while also providing verbose output produced by osv-scanner (I truncated the output but wanted to make aware that the `-v` option is available): ``` console pre-commit run -av osv-scanner..............................................................Passed - hook id: osv-scanner - duration: 0.47s .... // verbose output here ``` Let me know if there is an interest in using any of the other pre-commit hook [configurations ](https://pre-commit.com/#creating-new-hooks)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Can you support pre-commit-hook - just add .pre-commit-hook.yaml to repo and, if possible, use git tags for versioning.
Thanks
The text was updated successfully, but these errors were encountered: