-
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
Running tools through pre-commit #14
Comments
I don't understand the point of running
Adding the feature you ask for would mean that pre-commit will create a venv inside which uv is installed to create a venv to install the tool you ask for. Maybe you are looking for https://github.com/tox-dev/pre-commit-uv, this project uses uv to handle the python venv creation inside pre-commit. For ruff, I would recommended the supported pre-commit hook: - repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.6.1
hooks:
- id: ruff For mypy there is https://github.com/pre-commit/mirrors-mypy (but mypy is slow, pre-commit is maybe not the right place to run it) |
I also would be in favour of running Why not https://github.com/pre-commit/mirrors-mypy ? Indeed it would be nice if But this way the env I am currently helped myself with: - repo: local
hooks:
- id: mypy
name: mypy
entry: uv run mypy
args: []
language: system
types: [python] Which requires Having it here this requirement would vanish. |
I've opened WIP branch on my fork for the @CarliJoy would you mind giving it a go? I am interested if it works for your mypy use case. Something like this in the repos:
- repo: https://github.com/danielhollas/uv-pre-commit
rev: c2c5e6a1c7d17dd3c237aae6557d15a142b89b8c
hooks:
- id: uv-run
name: mypy type check
args: [mypy]
pass_filenames: true
types: [python] There are two disadvantages to this approach:
$ pre-commit run uv-run --all-files This would get awkward once you'd want to run multiple things via |
I would like the ability to use
uv tool run ruff
with this! Especially ruff and mypy!The text was updated successfully, but these errors were encountered: