chore: P1 工程化工具链
- pyproject.toml:pytest/black/isort/mypy 统一配置 - requirements-dev.txt:测试与代码规范开发依赖 - .flake8 / .editorconfig:PEP8 与编辑器统一 - .pre-commit-config.yaml:提交前钩子 - Makefile:常用命令集 - .env.example:环境变量模板(76 键) - tests/:pytest 骨架 + R 响应格式冒烟测试 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
15f2a5e097
commit
8691412ec6
@@ -0,0 +1,31 @@
|
||||
# ============================================================
|
||||
# flake8 配置(PEP8 检查)
|
||||
# 与 black(line-length=120) / isort(profile=black) 保持协调
|
||||
# ============================================================
|
||||
[flake8]
|
||||
# 行宽:与 black 一致;中文注释/长 URL 场景已由 black 统一管理格式
|
||||
max-line-length = 120
|
||||
# 圈复杂度上限(存量服务函数普遍偏高,新代码应低于此值)
|
||||
max-complexity = 20
|
||||
|
||||
# 排除目录
|
||||
exclude =
|
||||
.git,
|
||||
__pycache__,
|
||||
.venv,
|
||||
venv,
|
||||
migrations,
|
||||
static,
|
||||
uploads,
|
||||
ui,
|
||||
document,
|
||||
.idea,
|
||||
.claude,
|
||||
build,
|
||||
dist
|
||||
|
||||
# 与 black/isort 冲突项(必须忽略,否则与自动格式化互相打架)
|
||||
extend-ignore =
|
||||
E203, # 切片冒号前空格(black 风格)
|
||||
W503, # 二元运算符换行(black 风格)
|
||||
E501, # 行过长(交由 black 处理)
|
||||
Reference in New Issue
Block a user