feat: 添加 ruff + mypy CI 检查 (Issue #13)#24
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Code Review — PR #24: 添加 ruff + mypy CI 检查🔴 Critical1. ruff 和 mypy 都使用 - name: Ruff lint
run: |
ruff check agent_go/ --select=E,F --ignore=E501 --fix || true
- name: MyPy type check
run: |
mypy agent_go/ --ignore-missing-imports || true即使存在数百个 lint 违规或类型错误,CI 都会显示为"绿色",完全违背了 CI 门禁的目的。如果是为了渐进式采用,应添加注释说明,并创建一个跟踪 issue 后续移除 2. ruff 步骤的
🟡 Major3. 与 PR #23 在 两个 PR 都创建了同名文件但内容不同。需要协调合并顺序。 4. 缺少 Issue #13 明确提到 "添加 pyproject.toml (ruff + mypy 配置)"。没有它,本地开发者无法复现 CI 检查。 5. 不必要的 项目完全使用 6.
🟢 Minor
总结: 需修复 Critical #1-2(移除 |
…ll__ 修正 Critical 修复: - 移除 ruff/mypy 的 `|| true`,CI 检查失败将正确阻断流水线 - 移除 ruff 的 `--fix` 标志,CI 中不应原地修改文件 Major 修复: - 添加 pyproject.toml (ruff + mypy 配置),本地开发者可复现 CI 检查 - 移除 types-requests 依赖(项目仅使用 stdlib urllib.request) - __all__ 中移除 15 个 _ 前缀私有名称,添加 __version__ Minor 修复: - ruff 规则扩展: E,F → E,F,W (增加 warnings) - CI 依赖仅保留: pytest, pytest-mock, ruff, mypy Refs: #13 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… 反馈) (#29) Critical 修复: - 移除 ruff/mypy 的 `|| true`,CI 检查失败将正确阻断流水线 - 移除 ruff 的 `--fix` 标志,CI 中不应原地修改文件 Major 修复: - 添加 pyproject.toml (ruff + mypy 配置),本地开发者可复现 CI 检查 - 移除 types-requests 依赖(项目仅使用 stdlib urllib.request) - __all__ 中移除 15 个 _ 前缀私有名称,添加 __version__ Minor 修复: - ruff 规则扩展: E,F → E,F,W (增加 warnings) - CI 依赖仅保留: pytest, pytest-mock, ruff, mypy Refs: #13 Co-authored-by: jinsongwang <jinsongwang@agent-go.dev> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Summary
修复 Issue #13: 添加 ruff + mypy 自动化代码质量检查
修复
.github/workflows/test.ymlCI 配置测试
Checklist