Skip to content

Commit

Permalink
Add alembic hook for ruff checker & formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanymkanov committed Jun 13, 2024
1 parent f084753 commit 94a0fa0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,14 @@ sqlalchemy.url = driver://user:pass@localhost/dbname


[post_write_hooks]
# post_write_hooks defines scripts or Python functions that are run
# on newly generated revision scripts. See the documentation for further
# detail and examples
hooks = ruff_format,ruff
ruff_format.type = exec
ruff_format.executable = ruff
ruff_format.options = format REVISION_SCRIPT_FILENAME

# format using "black" - use the console_scripts runner, against the "black" entrypoint
hooks = ruff
ruff.type = exec
ruff.executable = ruff
ruff.options = format REVISION_SCRIPT_FILENAME
ruff.options = check --fix REVISION_SCRIPT_FILENAME

# Logging configuration
[loggers]
Expand Down

0 comments on commit 94a0fa0

Please sign in to comment.