-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
Provide a pre-commit hook for hatch fmt
#1223
Comments
I noticed this issue with I tried this and it worked for my use case. ref pre-committ-config.yaml
|
I am open to this but do not have any idea where to begin as I do not use |
Perhaps this article is useful? |
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am using Hatch for project management in my Python projects, and recently adopted
hatch fmt
instead of directly calling Ruff previously. I also usepre-commit
in my CI workflows to run several linters project-wide. Right now, I use Hatch for formatting locally and Ruff in the CI run ofpre-commit
.Ruff was recently updated (version 0.1.14) and its config now produces a different outcome than Hatch, since the latter depends on an older version (version 0.1.8 if I understood correctly). I can force Hatch to use an updated version of Ruff with:
so that both Ruff and Hatch are in agreement. It's not awful, but there is now a redundancy between Hatch's configuration and Ruff's pre-commit setup.
Instead, I was wondering whether a pre-commit hook could be introduced for Hatch to just run
hatch fmt
, with or without an updated version of Ruff based on thedependencies
setting above.Cheers, and thanks for your wonderful work on Hatch.
The text was updated successfully, but these errors were encountered: