-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathruff.toml
More file actions
33 lines (30 loc) · 1.41 KB
/
Copy pathruff.toml
File metadata and controls
33 lines (30 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
line-length = 88
target-version = "py39"
[lint]
select = ["E", "F", "W", "I", "B", "N", "UP"]
ignore = [
# 保留的 ignore(有合理原因)
"E402", # 模块级 import: examples 中条件导入/延迟导入
"E501", # 行太长:代码格式化后的自然结果
"B008", # Typer/FastAPI: 函数默认参数中的调用是框架惯用法
"B904", # raise from: 覆盖面太大(111 处),逐个修复成本高
"B027", # 空抽象方法: 插件钩子
"N802", # 函数名风格: 内部回调/路由函数(如 verifyGET, messagePOST)
"N805", # 方法首参数: discord.Client inner_self 绕过
"N806", # 变量名: TraceContext 类引用
"N815", # 类变量大写:API 响应字段
"B005", # strip 多字符: 测试代码中的 SSE 解析
"B023", # 循环变量闭包: cli_local_models 的 stream_chat
"UP045", # X | None: CI 运行 Python 3.9(不支持联合类型语法)
# 以下规则已修复,但保留 ignore 以防未来新增:
# E722 (bare except): 已修复为 except Exception
# F841 (未使用变量): 已加 _ 前缀或 # noqa
# F401 (未使用导入): 已删除
# W293 (尾部空格): 已清理
# W292 (文件末尾换行): 已添加
# B905 (zip strict): 已加 strict=False
# B007 (未用循环变量): 已加 _ 前缀
]
[lint.per-file-ignores]
"tests/*" = ["B905", "UP045"]
"src/*" = ["B905", "UP045"]