Running the ruff formatter as an Alembic post_write_hooks
#8949
Unanswered
lukecivantos
asked this question in
Q&A
Replies: 2 comments 4 replies
-
What about something like...
|
Beta Was this translation helpful? Give feedback.
4 replies
-
Another solution if you are already using pre-commit with ruff (https://github.com/astral-sh/ruff-pre-commit), for example: # .pre-commit-config.yaml
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
- id: ruff-format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
- id: ruff
args: [--fix] then, the following hook:
will do the trick and will find underlying path to ruff binary and run it seamlessly, and trigger whatever you have in pre-commit, even more stuff than ruff only. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey all!
I'm currently looking into moving from Black to the Ruff formatter – one issue I'm bumping up against is how I might run the ruff formatter as a post write hook in Alembic. In my
alembic.ini
file I currently have the code below which runs black & the ruff linter, but I'm not sure what the entrypoint would be for ruff's formatter here.Any help is appreciated – thanks!
Beta Was this translation helpful? Give feedback.
All reactions