refactor(project): make pyright & ruff happy

This commit is contained in:
MingxuanGame
2025-08-22 08:21:52 +00:00
parent 3b1d7a2234
commit 598fcc8b38
157 changed files with 2382 additions and 4590 deletions

View File

@@ -30,9 +30,7 @@ def upgrade() -> None:
sa.Column("user_id", sa.BigInteger(), nullable=True),
sa.Column(
"mode",
sa.Enum(
"OSU", "TAIKO", "FRUITS", "MANIA", "OSURX", "OSUAP", name="gamemode"
),
sa.Enum("OSU", "TAIKO", "FRUITS", "MANIA", "OSURX", "OSUAP", name="gamemode"),
nullable=False,
),
sa.Column("rank", sa.Integer(), nullable=False),
@@ -43,21 +41,15 @@ def upgrade() -> None:
),
sa.PrimaryKeyConstraint("id"),
)
op.create_index(
op.f("ix_rank_history_date"), "rank_history", ["date"], unique=False
)
op.create_index(
op.f("ix_rank_history_user_id"), "rank_history", ["user_id"], unique=False
)
op.create_index(op.f("ix_rank_history_date"), "rank_history", ["date"], unique=False)
op.create_index(op.f("ix_rank_history_user_id"), "rank_history", ["user_id"], unique=False)
op.create_table(
"rank_top",
sa.Column("id", sa.BigInteger(), nullable=False),
sa.Column("user_id", sa.BigInteger(), nullable=True),
sa.Column(
"mode",
sa.Enum(
"OSU", "TAIKO", "FRUITS", "MANIA", "OSURX", "OSUAP", name="gamemode"
),
sa.Enum("OSU", "TAIKO", "FRUITS", "MANIA", "OSURX", "OSUAP", name="gamemode"),
nullable=False,
),
sa.Column("rank", sa.Integer(), nullable=False),
@@ -84,9 +76,7 @@ def upgrade() -> None:
)
op.drop_column("lazer_user_statistics", "country_rank")
op.drop_column("lazer_user_statistics", "global_rank")
op.create_index(
op.f("ix_oauth_clients_name"), "oauth_clients", ["name"], unique=False
)
op.create_index(op.f("ix_oauth_clients_name"), "oauth_clients", ["name"], unique=False)
# ### end Alembic commands ###
@@ -102,12 +92,8 @@ def downgrade() -> None:
"lazer_user_statistics",
sa.Column("country_rank", mysql.INTEGER(), autoincrement=False, nullable=True),
)
op.drop_index(
op.f("ix_lazer_user_statistics_pp"), table_name="lazer_user_statistics"
)
op.drop_index(
op.f("ix_lazer_user_statistics_mode"), table_name="lazer_user_statistics"
)
op.drop_index(op.f("ix_lazer_user_statistics_pp"), table_name="lazer_user_statistics")
op.drop_index(op.f("ix_lazer_user_statistics_mode"), table_name="lazer_user_statistics")
op.drop_table("rank_top")
op.drop_table("rank_history")
# ### end Alembic commands ###