Skip to content

Conversation

@EdAbati
Copy link
Contributor

@EdAbati EdAbati commented Aug 1, 2025

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:

$ 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 :)

Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Thanks!

@zanieb zanieb merged commit 9edd84d into astral-sh:main Aug 1, 2025
@zanieb
Copy link
Member

zanieb commented Aug 1, 2025

and thanks for the kind words :)

wpk-nist-gov pushed a commit to wpk-nist-gov/uv-pre-commit that referenced this pull request Nov 13, 2025
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 :)
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.

2 participants