line-length = 100 target-version = "py310" # 忽略常見產物與虛擬環境資料夾 extend-exclude = [ ".venv", "venv", ".tox", ".mypy_cache", ".pytest_cache", ".ruff_cache", "build", "dist", "node_modules", ] [lint] # 基本錯誤/風格 + 匯入排序 + pyupgrade + bugbear select = ["E", "F", "I", "UP", "B"] # 允許自動修復所有可修復項目(VS Code 會透過 Code Action 觸發) fixable = ["ALL"] [lint.isort] # 預設與 Black 兼容的行為已良好,一般無需額外調整 [format] # 格式器偏好(VS Code 也設定了 LF 與 ruler 88) quote-style = "double" # 可選:"single" | "double" | "preserve" indent-style = "space" # 可選:"space" | "tab" line-ending = "lf" # 可選:"lf" | "cr-lf" | "auto" # 若文件含有 docstring 內嵌程式碼,可一併格式化 docstring-code-format = true docstring-code-line-length = 100