45 lines
1.5 KiB
TOML
45 lines
1.5 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=42", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.ruff]
|
|
# Allow lines to be as long as 100 characters
|
|
line-length = 100
|
|
# Assume Python 3.8
|
|
target-version = "py38"
|
|
|
|
[tool.ruff.lint]
|
|
# Enable pycodestyle (E), Pyflakes (F), isort (I), and more
|
|
select = ["E", "F", "I", "N", "W", "C90", "B", "UP"]
|
|
# Ignore specific rules:
|
|
# B008: Do not perform function call `Depends` in argument defaults
|
|
# E501: Line too long
|
|
# F401: Imported but unused
|
|
ignore = ["B008", "E501", "F401"]
|
|
|
|
# Allow autofix for all enabled rules (when `--fix`) is provided
|
|
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
|
|
unfixable = []
|
|
|
|
# Exclude a variety of commonly ignored directories
|
|
exclude = [
|
|
".git",
|
|
".ruff_cache",
|
|
".venv",
|
|
"venv",
|
|
"__pypackages__",
|
|
"migrations/versions",
|
|
"dist",
|
|
"node_modules",
|
|
]
|
|
|
|
# Allow unused variables when underscore-prefixed.
|
|
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
|
|
|
[tool.ruff.lint.mccabe]
|
|
# Flag functions with a complexity higher than 15
|
|
max-complexity = 15
|
|
|
|
[tool.ruff.lint.isort]
|
|
known-third-party = ["fastapi", "pydantic", "sqlalchemy", "alembic"]
|
|
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"] |