Update the ruff rules and format the code (#846)

* Update the ruff rules and format the code

* Update the per-file-ignores

* Update the ci

* Update rules

* Fix codes

* Fix pagination

* Update rules
This commit is contained in:
Wu Clan
2025-10-10 19:02:49 +08:00
committed by GitHub
parent 51354593d0
commit 5762834744
269 changed files with 975 additions and 1198 deletions
+11 -6
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from typing import TYPE_CHECKING, Union
from __future__ import annotations
from typing import TYPE_CHECKING
from sqlalchemy import BigInteger, ForeignKey, String
from sqlalchemy.dialects.mysql import LONGTEXT
@@ -24,7 +24,9 @@ class GenColumn(DataClassBase):
type: Mapped[str] = mapped_column(String(20), default='String', comment='SQLA 模型列类型')
pd_type: Mapped[str] = mapped_column(String(20), default='str', comment='列类型对应的 pydantic 类型')
default: Mapped[str | None] = mapped_column(
LONGTEXT().with_variant(TEXT, 'postgresql'), default=None, comment='列默认值'
LONGTEXT().with_variant(TEXT, 'postgresql'),
default=None,
comment='列默认值',
)
sort: Mapped[int | None] = mapped_column(default=1, comment='列排序')
length: Mapped[int] = mapped_column(default=0, comment='列长度')
@@ -33,6 +35,9 @@ class GenColumn(DataClassBase):
# 代码生成业务模型列一对多
gen_business_id: Mapped[int] = mapped_column(
BigInteger, ForeignKey('gen_business.id', ondelete='CASCADE'), default=0, comment='代码生成业务ID'
BigInteger,
ForeignKey('gen_business.id', ondelete='CASCADE'),
default=0,
comment='代码生成业务ID',
)
gen_business: Mapped[Union['GenBusiness', None]] = relationship(init=False, back_populates='gen_column')
gen_business: Mapped[GenBusiness | None] = relationship(init=False, back_populates='gen_column')