Skip to content

Generated alembic migration script disagrees with linter #1227

@nmaytan

Description

@nmaytan

This is a minor detail: if you generate a database migration script with alembic, the current mako template puts single quotes around the revision identifiers whereas the linter wants double quotes.

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}

My understanding is that the values of these identifies can be different datatypes depending on the context, so making this consistent with the linter while maintaining the correct form requires at least a little thought.

Catalog migrations should have the same issue:

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}

While everyone runs pre-commit before committing (obviously, nobody would ever forget), making generated files agree with the linter in the first place is good QoL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions