-
Notifications
You must be signed in to change notification settings - Fork 443
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 to run arbitrary entrypoints even if they don't have native pre-commit support #981
Conversation
Since you basically should not use anything but Also it would be a good idea to add a link to pre-commit documentation in the section describing this. |
@uranusjr; I initially tried this with |
I've updated the README to reference installation.doc for the pre-commit code snippet. |
7352042
to
32ab64d
Compare
Co-authored-by: chrysle <[email protected]>
Co-authored-by: chrysle <[email protected]>
Co-authored-by: chrysle <[email protected]>
docs/installation.md
Outdated
|
||
```yaml | ||
- repo: https://github.com/pypa/pipx | ||
rev: 1.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rev: 1.3.0 | |
rev: 1.2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pre-commit performs a git checkout
against rev:
and then looks for the .pre-commit-hooks.yaml
file in the worktree; rev: 1.2.0
won't work as the file will be missing.
It looks like PRs are merged in pipx using the "squash" strategy, docs/installation.md
will need to be updated post merge to update rev:
to a valid commit hash.
I’m still very inclined to make this only possible to run |
I've successfully tested using |
require_serial is not settable in config.yaml, only hooks; so have two separate versions.
Add pipx-serial
279c2f3
to
be97c76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ready when CI passes.
All's passed! |
docs/changelog.md
Summary of changes
Add support for using pipx as a pre-commit hook for arbitrary python packages that do not have a pre-commit hook configured.
Some package utilities I'd like to use even but they don't have a pre-commit hook configured for them.
This allows configuration like the following to be added to a project
.pre-commit-config.yaml
file to run the script.With the previous config the following command runs yapf against pipx's
get-pipx.py
as an example:Test plan
Tested by running the configuration from "Summary of changes" against my local pipx repo.