Enable SIM in flake8 and ruff

This commit is contained in:
Alexander Hess 2026-11-30 20:57:31 +01:00
commit 007998372f
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -21,14 +21,11 @@ log_config.fileConfig(context.config.config_file_name)
def include_object(obj, _name, type_, _reflected, _compare_to):
"""Only include the clean schema into --autogenerate migrations."""
if (
return not (
type_ in {"table", "column"}
and hasattr(obj, "schema") # => fix for rare edge case
and obj.schema != pkg_config.CLEAN_SCHEMA
):
return False
return True
)
# Without a `pool`, the `connection` really closes after the migrations