ruff.toml•1.04 kB
# 允许的最大行长度
line-length = 120
# 目标 Python 版本
target-version = "py312"
# 排除的文件和目录
exclude = [
".git",
".github",
".pytest_cache",
".vscode",
".venv",
"__pycache__",
"build",
"dist",
"python_example",
]
# 启用Ruff的所有规则
select = ["ALL"]
# 忽略的规则
ignore = [
"D100", # 缺少模块级docstring
"D101", # 缺少公共类docstring
"D102", # 缺少公共方法docstring
"D103", # 缺少公共函数docstring
"D104", # 缺少包级docstring
"RUF001", # 忽略全角逗号警告
"F403", # 忽略 'from module import *' 使用的警告
"F405", # 忽略 'name may be undefined, or defined from star imports' 警告
]
# 自动修复设置
fix = true
show-fixes = true
# 导入排序设置
[isort]
known-first-party = ["models", "routers", "utils", "dependencies", "src"]
force-single-line = true
# 格式化设置
[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false