diff --git a/alembic-migrations/versions/2024_07_21_1854-c55da3c62644_initial_migration.py b/alembic-migrations/versions/2024_07_21_1854-c55da3c62644_initial_migration.py index 2facb6a..0ee2d3f 100644 --- a/alembic-migrations/versions/2024_07_21_1854-c55da3c62644_initial_migration.py +++ b/alembic-migrations/versions/2024_07_21_1854-c55da3c62644_initial_migration.py @@ -1,17 +1,14 @@ """Initial migration Revision ID: c55da3c62644 -Revises: +Revises: Create Date: 2024-07-21 18:54:26.159716 """ from collections.abc import Sequence -import sqlalchemy as sa -from alembic import op - # revision identifiers, used by Alembic. -revision: str = 'c55da3c62644' +revision: str = "c55da3c62644" down_revision: str | None = None branch_labels: str | Sequence[str] | None = None depends_on: str | Sequence[str] | None = None diff --git a/alembic.ini b/alembic.ini index e6bfdae..87142fa 100644 --- a/alembic.ini +++ b/alembic.ini @@ -69,18 +69,18 @@ sqlalchemy.url = driver://user:pass@localhost/dbname # post_write_hooks defines scripts or Python functions that are run # on newly generated revision scripts. See the documentation for further # detail and examples +# https://alembic.sqlalchemy.org/en/latest/autogenerate.html#basic-post-processor-configuration + +hooks = ruff-autofix, ruff-format + +ruff-autofix.type = exec +ruff-autofix.executable = %(here)s/.venv/bin/ruff +ruff-autofix.options = check --fix REVISION_SCRIPT_FILENAME + +ruff-format.type = exec +ruff-format.executable = %(here)s/.venv/bin/ruff +ruff-format.options = format REVISION_SCRIPT_FILENAME -# format using "black" - use the console_scripts runner, against the "black" entrypoint -# hooks = black -# black.type = console_scripts -# black.entrypoint = black -# black.options = -l 79 REVISION_SCRIPT_FILENAME - -# lint with attempts to fix using "ruff" - use the exec runner, execute a binary -# hooks = ruff -# ruff.type = exec -# ruff.executable = %(here)s/.venv/bin/ruff -# ruff.options = --fix REVISION_SCRIPT_FILENAME # Logging configuration [loggers] diff --git a/pyproject.toml b/pyproject.toml index ee704e8..858db94 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ authors = [ "Benji ", "Paillat-dev ", "v33010 ", - "Ash8121 " + "Ash8121 ", ] readme = "README.md" license = "MIT" @@ -35,7 +35,7 @@ pytest-cov = "^5.0.0" [tool.poetry.group.dev.dependencies] -datamodel-code-generator = {extras = ["http"], version = "^0.25.8"} +datamodel-code-generator = { extras = ["http"], version = "^0.25.8" } [tool.datamodel-codegen] @@ -172,17 +172,13 @@ max-statements = 75 ] "alembic-migrations/versions/*" = [ "INP001", # Implicit namespace package - "W291", # Trailing whitespace "D103", # Missing docstring in public function "D400", # First line should end with a period "D415", # First line should end with a period, question mark, or exclamation point - "F401", # Unused import - "Q000", # Single quotes found but double quotes preferred ] [tool.ruff.format] line-ending = "lf" -exclude = ["alembic-migrations/versions/*.py"] [tool.basedpyright] pythonPlatform = "All"