chore: 审计记录 + 修复 repo_root.py 仓库根检测
- 审计记录:2026-04-06__v1-cleanup-ddl-consolidation.md - 刷新审计一览表(125 条记录) - 修复 repo_root.py:.kiro 已删除后改用 pyproject.toml + CLAUDE.md 检测 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,12 +19,15 @@ import os
|
||||
import warnings
|
||||
from pathlib import Path
|
||||
|
||||
# 仓库根的标志文件组合(同时存在才算)
|
||||
_MARKERS = ("pyproject.toml", ".kiro")
|
||||
# 仓库根的标志文件组合(pyproject.toml 必须存在 + 至少一个辅助标志)
|
||||
_REQUIRED = "pyproject.toml"
|
||||
_AUX_MARKERS = ("CLAUDE.md", ".claude", ".kiro")
|
||||
|
||||
|
||||
def _is_repo_root(p: Path) -> bool:
|
||||
return (p / "pyproject.toml").is_file() and (p / ".kiro").is_dir()
|
||||
if not (p / _REQUIRED).is_file():
|
||||
return False
|
||||
return any((p / m).exists() for m in _AUX_MARKERS)
|
||||
|
||||
|
||||
def _find_root_from_file(anchor: Path, max_depth: int = 8) -> Path | None:
|
||||
|
||||
Reference in New Issue
Block a user