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,39 @@
|
||||
# ============================================================
|
||||
# pre-commit 钩子配置
|
||||
# 安装:pip install -r requirements-dev.txt && pre-commit install
|
||||
# 手动全量运行:pre-commit run --all-files
|
||||
# ============================================================
|
||||
repos:
|
||||
# ---- 通用钩子 ----
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: check-yaml
|
||||
- id: check-json
|
||||
- id: check-merge-conflict
|
||||
- id: debug-statements
|
||||
- id: detect-private-key
|
||||
# ip2region.xdb 约 10MB,放行大文件
|
||||
- id: check-added-large-files
|
||||
args: ["--maxkb=12000"]
|
||||
|
||||
# ---- Python 格式化:black ----
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 24.10.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ["--line-length", "120"]
|
||||
|
||||
# ---- import 排序:isort ----
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.13.2
|
||||
hooks:
|
||||
- id: isort
|
||||
|
||||
# ---- 静态检查:flake8 ----
|
||||
- repo: https://github.com/PyCQA/flake8
|
||||
rev: 7.1.1
|
||||
hooks:
|
||||
- id: flake8
|
||||
Reference in New Issue
Block a user