-
Notifications
You must be signed in to change notification settings - Fork 11
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
uv-export behavior #39
Comments
Do you have that file checked in your repo? I think pre-commit should automatically detect if a file under version control was changed during hook execution and fail the hook accordingly. But I might be wrong... |
It's possible that when I first set up pre-commit I didn't have requirements.txt checked in. I do now and just tried to reproduce the issue and could not reproduce it—committing a change to the lock file triggered the uv export action, which "failed" and thus blocked the commit (adding an unstaged change to requirements for me to stage). In that case, this may have been user error! |
I would expect the uv-export..................................................................Failed
- hook id: uv-export
- files were modified by this hook Initially, I thought the hook always passed incorrectly, but it turned out that I really love Update: To answer my own message, this is the correct way to set up the hook to use - repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.29
hooks:
- id: uv-lock
- id: uv-export
args:
- --no-hashes
- --output-file=requirements.txt |
Hi, thanks for this helpful pre-commit plugin.
One thing I noticed was that uv-export is marked as "passed" even if it generates a brand new requirements file. I'd expect it to only pass if it creates no new changes, and to fail (and force me to add requirements then recommit) otherwise. Is there a way to enable that behavior?
Thanks!
Dan
The text was updated successfully, but these errors were encountered: