Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ci:
autoupdate_commit_msg: ":arrow_up: auto update by pre-commit hooks"
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.15.15
hooks:
- id: ruff
args: [--fix]
Expand Down
3 changes: 1 addition & 2 deletions zhenxun/builtin_plugins/hooks/auth/auth_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ async def auth_admin(
raise SkipPluginException(
f"{plugin.name}({plugin.module}) 管理员权限不足...",
tip_message=(
f"你的权限不足喔,该功能需要的权限等级: "
f"{plugin.admin_level}"
f"你的权限不足喔,该功能需要的权限等级: {plugin.admin_level}"
),
tip_background=True,
)
Expand Down
2 changes: 1 addition & 1 deletion zhenxun/builtin_plugins/scheduler/auto_update_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ async def _prune_stale_tags():
deleted_count = await tag_manager.prune_stale_group_links()
if deleted_count > 0:
logger.info(
f"定时任务:成功清理了 {deleted_count} 个无效的群组标签" f"关联。",
f"定时任务:成功清理了 {deleted_count} 个无效的群组标签关联。",
"群组标签管理",
)
else:
Expand Down
6 changes: 3 additions & 3 deletions zhenxun/builtin_plugins/sign_in/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
lik2relation,
)

assert (
len(level2attitude) == len(lik2level) == len(lik2relation)
), "好感度态度、等级、关系长度不匹配!"
assert len(level2attitude) == len(lik2level) == len(lik2relation), (
"好感度态度、等级、关系长度不匹配!"
)

AVA_URL = "http://q1.qlogo.cn/g?b=qq&nk={}&s=160"

Expand Down
5 changes: 3 additions & 2 deletions zhenxun/builtin_plugins/superuser/tag_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,9 @@ async def handle_delete(names: Match[list[str]]):
async def handle_clear():
confirm = await prompt_until(
"【警告】此操作将删除所有群组标签,是否继续?\n请输入 `是` 或 `确定` 确认操作",
lambda msg: msg.extract_plain_text().lower()
in ["是", "确定", "yes", "confirm"],
lambda msg: (
msg.extract_plain_text().lower() in ["是", "确定", "yes", "confirm"]
),
timeout=30,
retry=1,
)
Expand Down
4 changes: 1 addition & 3 deletions zhenxun/services/db_context/schema_guard.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,7 @@ def _index_sql(table: str, columns: tuple[str, ...], dialect: Dialect) -> str |
index_sql = _quote_identifier(_index_name(table, columns), dialect)
columns_sql = ", ".join(_quote_identifier(column, dialect) for column in columns)
if dialect in {"sqlite", "postgres"}:
return (
f"CREATE INDEX IF NOT EXISTS {index_sql} " f"ON {table_sql}({columns_sql})"
)
return f"CREATE INDEX IF NOT EXISTS {index_sql} ON {table_sql}({columns_sql})"
if dialect == "mysql":
return f"CREATE INDEX {index_sql} ON {table_sql}({columns_sql})"
return None
Expand Down
Loading