Skip to content

fix: import 管理规范化 — E402 清零 + CI/pyproject 文档化 (Issue #31)#33

Merged
urika merged 1 commit into
mainfrom
fix/issue-31-import-guardrails
May 30, 2026
Merged

fix: import 管理规范化 — E402 清零 + CI/pyproject 文档化 (Issue #31)#33
urika merged 1 commit into
mainfrom
fix/issue-31-import-guardrails

Conversation

@urika

@urika urika commented May 30, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #31 Subtask 2

Changes

Change File(s) Detail
CI 注释 .github/workflows/test.yml ruff lint 步骤标注含 F401
pyproject 文档化 pyproject.toml F401/F 规则用途注释
E402 修复 api.py cli.py pipeline.py role_skill_map.py logger = logging.getLogger() 移至所有 import 之后
stdlib 归位 api.py import hashlib 移至 stdlib 区

Verification

  • ruff check --select E402 agent_go/: 0 errors
  • ruff check --select F401 agent_go/: 0 errors
  • pytest tests/: 277 passed

Why no common import module?

After Subtask 1 (F401 cleanup), each module imports only what it actually uses. A shared _imports.py module would add indirection without benefit — explicit per-module imports are more readable and maintainable.

CI Guard

--select=E,F,W in CI already covers:

  • E: pycodestyle (incl. E401 multi-import, E402 import-order)
  • F: Pyflakes (incl. F401 unused-import)
  • W: pycodestyle warnings

🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

- pyproject.toml: F401 (unused-import) 显式标注
- CI: ruff lint 步骤添加 F401 注释
- api/cli/pipeline/role_skill_map: logger 定义移至所有 import 之后,消除 E402
- ruff E402 (模块级导入顺序): 0 errors
- ruff F401 (unused-import): 0 errors

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@urika urika merged commit 52f7500 into main May 30, 2026
1 check failed
@urika urika deleted the fix/issue-31-import-guardrails branch May 30, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code Quality] 代码清理三合一 — import 统一、未使用导入清理、输出抽象层

1 participant