style: apply ruff format across backend + scripts (line-length 100)
Mechanical, whole-tree `ruff format` pass — no behaviour change. Recorded in .git-blame-ignore-revs (next commit) so git blame skips it.
This commit is contained in:
@@ -16,6 +16,7 @@ constraints, SERIAL sequences) that can't be expressed on `Base.metadata`, so co
|
||||
noise; they're filtered out. The column/table signal is the "someone changed a model without a migration"
|
||||
case worth failing on.
|
||||
"""
|
||||
|
||||
from alembic import command
|
||||
from alembic.autogenerate import compare_metadata
|
||||
from alembic.config import Config
|
||||
@@ -26,7 +27,12 @@ from app.db import Base, engine
|
||||
# The diff ops that mean a real table/column disagreement (presence AND shape) — not the index/
|
||||
# constraint/sequence noise from migration-only objects.
|
||||
_DRIFT_OPS = {
|
||||
"add_table", "remove_table", "add_column", "remove_column", "modify_type", "modify_nullable",
|
||||
"add_table",
|
||||
"remove_table",
|
||||
"add_column",
|
||||
"remove_column",
|
||||
"modify_type",
|
||||
"modify_nullable",
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +45,7 @@ def _structural_drift():
|
||||
diffs = compare_metadata(ctx, Base.metadata)
|
||||
drift = []
|
||||
for d in diffs:
|
||||
for entry in (d if isinstance(d, list) else [d]):
|
||||
for entry in d if isinstance(d, list) else [d]:
|
||||
if isinstance(entry, tuple) and entry and entry[0] in _DRIFT_OPS:
|
||||
drift.append(entry)
|
||||
return drift
|
||||
|
||||
Reference in New Issue
Block a user