-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
40 lines (35 loc) · 999 Bytes
/
pyproject.toml
File metadata and controls
40 lines (35 loc) · 999 Bytes
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
34
35
36
37
38
39
40
[tool.ruff]
# 排除 ruff 不應檢查的資料夾
# 注意:.venv, .git, build, dist 等資料夾 Ruff 會自動排除
exclude = [
"migrations/",
"__pycache__/",
".eggs/",
".hg/",
".mypy_cache/",
".tox/",
"_build/",
"buck-out/",
"alembic/"
]
# 告訴 Ruff 你的程式碼是為 Python 3.12 編寫的 (相容 3.14)
target-version = "py312"
line-length = 88
# --- Ruff Linter (檢查器) 的設定 ---
[tool.ruff.lint]
# 啟用核心規則:
# E/W: pycodestyle (風格)
# F: Pyflakes (邏輯錯誤,如未使用的 import)
# I: isort (import 排序)
# UP: pyupgrade (升級到現代語法)
# B: flake8-bugbear (常見 Bug)
# N: pep8-naming (pep8 命名風格)
select = ["E", "F", "W", "I", "UP", "B", "N"]
# 忽略特定規則
# B008: FastAPI Depends() in function defaults is standard practice
ignore = ["B008"]
# --- Ruff Formatter (格式化器) 的設定 ---
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true