-
Notifications
You must be signed in to change notification settings - Fork 19
feat: add uv-run hook #53
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
Open
wpk-nist-gov
wants to merge
53
commits into
astral-sh:main
Choose a base branch
from
wpk-nist-gov:add-uv-run-hook
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
make default to use `--no-active` and not to pass filenames
dctaf
reviewed
Jul 25, 2025
|
@wpk-nist-gov @zanieb This looks super useful. Is there anything I can do to help make this land? |
Hi, First time interacting with a `astral-sh` repo, so first of all thank you very much for developing amazing tools like `uv` an `ruff`. :) In this PR, I am proposing to use the quiet output by default in the `uv-export` hook. Currently the hook will also print the whole export. This output (which also includes hashes) that can quickly become very very long and therefore it makes it harder to inspect the rest of `pre-commit` results. IMO verbose outputs in `pre-commit` hooks make sense when they show specific actionable errors (e.g. `ruff` or typing errors). In this case, the hook could simplify just fail and regenerate the file: ```console $ pre-commit run --all-files trim trailing whitespace.................................................Passed fix end of files.........................................................Passed check toml...............................................................Passed check yaml...............................................................Passed check json...............................................................Passed check for merge conflicts................................................Passed check for added large files..............................................Passed debug statements (python)................................................Passed detect private key.......................................................Passed ruff.....................................................................Passed uv-export................................................................Failed - hook id: uv-export - files were modified by this hook ``` This is a bit of personal preference I guess, so happy to close this PR if you don't agree :)
Fixes two minor pins, adds a Dependabot config that'll keep GHA updated. No functional changes. Signed-off-by: William Woodruff <[email protected]>
Per astral-sh#57 (comment). Signed-off-by: William Woodruff <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds a
uv-runhook. This allows, for example, using pre-commit to call scripts with inline metadata.I made this PR before I saw #42. The hooks are the same, but this PR includes snippet in the README.md. Closes #37 and #14.
Note that I considered also adding a
uv-tool-runhook, but if someone want to do that, they can just overrideentrywith something like