Skip to content

Commit 6982542

Browse files
style: apply ruff format to src/schemaforge/parsers/sqlalchemy_parser.py
1 parent 3c295e0 commit 6982542

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎src/schemaforge/parsers/sqlalchemy_parser.py‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Parser: SQLAlchemy declarative model schema → SchemaForge IR."""
2+
23
from __future__ import annotations
34

45
import contextlib
@@ -90,8 +91,12 @@ class Product(DeclarativeBase):
9091
model_name = model_m.group(1)
9192
base_name = model_m.group(2)
9293
# Skip base class definitions themselves
93-
if base_name.lower() in ("declarative_base", "declarativebase",
94-
"as_declarative", "registry"):
94+
if base_name.lower() in (
95+
"declarative_base",
96+
"declarativebase",
97+
"as_declarative",
98+
"registry",
99+
):
95100
i += 1
96101
continue
97102
# Check if any base looks like a declarative base
@@ -187,7 +192,7 @@ def _parse_model(self, name: str, body: str) -> Table | None:
187192
if paren_depth == 0:
188193
args_end = args_start + j
189194
break
190-
col_args = stripped[args_start + 1:args_end]
195+
col_args = stripped[args_start + 1 : args_end]
191196

192197
# Parse the Column contents
193198
col = self._parse_column(col_name, col_args)
@@ -338,8 +343,9 @@ def _parse_kwargs(self, args: list[str]) -> dict[str, str]:
338343
value = kv_match.group(2).strip()
339344

340345
# Strip quotes from string values
341-
if (value.startswith('"') and value.endswith('"')) or \
342-
(value.startswith("'") and value.endswith("'")):
346+
if (value.startswith('"') and value.endswith('"')) or (
347+
value.startswith("'") and value.endswith("'")
348+
):
343349
kwargs[key] = value[1:-1]
344350
elif value.lower() in ("true", "false"):
345351
kwargs[key] = value.lower()

0 commit comments

Comments
 (0)