[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "config.settings"
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
testpaths = ["apps"]
addopts = "-v --reuse-db"

[tool.pylint]
django-settings-module = "config.settings"
load-plugins = "pylint_django"

[tool.pylint.messages_control]
disable = [
  "missing-docstring",
  "invalid-name",
  "too-few-public-methods",
  "no-member",
  "import-error",
  "no-name-in-module",
  "wrong-import-position",   # 允许函数内导入（防循环依赖）
  "import-outside-toplevel", # 同上
  "too-many-arguments",      # Django 视图/服务方法参数常超过5个
  "too-many-locals",         # 复杂业务逻辑局部变量多
  "duplicate-code",          # 某些模式代码相似是正常的
]

[tool.pylint.format]
max-line-length = 120

[tool.pylint.basic]
good-names = [
  "i",
  "j",
  "k",
  "ex",
  "Run",
  "_",
  "id",
  "pk",
  "ip",
  "url",
  "db",
  "qs",
]
