Skip to content

Commit

Permalink
chore: Update ruff.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanCardin committed Jan 31, 2024
1 parent 1bb8552 commit 176e42c
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 64 deletions.
106 changes: 53 additions & 53 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ psycopg = "*"
alembic-utils = "0.8.1"
black = ">=22.3.0"
coverage = ">=5"
ruff = "0.0.259"
ruff = "0.1.15"
mypy = "1.4.1"
pytest = ">=7"
pytest-xdist = "*"
Expand Down Expand Up @@ -132,7 +132,7 @@ extend-ignore = [
known-first-party = ["sqlalchemy_declarative_extensions", "tests"]

[tool.ruff.per-file-ignores]
"tests/**/*.py" = ["D", "S"]
"tests/**/*.py" = ["D", "S", 'RUF012']

[build-system]
requires = ["poetry_core>=1.0.8"]
Expand Down
8 changes: 2 additions & 6 deletions src/sqlalchemy_declarative_extensions/alembic/row.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def compare_rows(autogen_context: AutogenContext, upgrade_ops: UpgradeOps, _):

@renderers.dispatch_for(InsertRowOp)
def render_insert_table_row(_, op: InsertRowOp):
return "op.insert_table_row('{table}', {values})".format(
table=op.table, values=op.values
)
return f"op.insert_table_row('{op.table}', {op.values})"


@renderers.dispatch_for(UpdateRowOp)
Expand All @@ -52,9 +50,7 @@ def render_update_table_row(_, op: UpdateRowOp):

@renderers.dispatch_for(DeleteRowOp)
def render_delete_table_row(_, op: DeleteRowOp):
return "op.delete_table_row('{table}', {values})".format(
table=op.table, values=op.values
)
return f"op.delete_table_row('{op.table}', {op.values})"


@Operations.implementation_for(InsertRowOp)
Expand Down
3 changes: 1 addition & 2 deletions src/sqlalchemy_declarative_extensions/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def create_audit_table(
if col.name not in ignore_columns
]

table = Table(
return Table(
table_name,
metadata,
primary_key_column,
Expand All @@ -164,7 +164,6 @@ def create_audit_table(
*table_columns,
schema=schema or table.schema,
)
return table


def create_audit_functions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def options(self):

def __repr__(self):
cls_name = self.__class__.__name__
options = ", ".join([f"{key}={repr(value)}" for key, value in self.options])
options = ", ".join([f"{key}={value!r}" for key, value in self.options])
return f'{cls_name}("{self.name}", {options})'

def to_sql_create(self) -> str:
Expand Down

0 comments on commit 176e42c

Please sign in to comment.