Merge commit '3d83740f88b6aaba6962256be517656496b83f25' into lsp-server
This commit is contained in:
@@ -79,7 +79,7 @@ echo ""
|
||||
echo "🔍 验证 memory-bank 模板"
|
||||
|
||||
MEMORY_BANK_DIR="$TEMPLATES_DIR/memory-bank"
|
||||
for name in project-brief tech-stack architecture progress decisions; do
|
||||
for name in project-brief tech-context system-patterns active-context progress decisions; do
|
||||
validate_file_exists "$MEMORY_BANK_DIR/$name.template.md" "memory-bank/$name.template.md"
|
||||
done
|
||||
|
||||
@@ -90,9 +90,10 @@ PROMPTS_DIR="$TEMPLATES_DIR/prompts"
|
||||
validate_file_exists "$PROMPTS_DIR/README.md" "prompts/README.md"
|
||||
validate_file_exists "$PROMPTS_DIR/system/agent-behavior.template.md" "prompts/system/agent-behavior.template.md"
|
||||
validate_file_exists "$PROMPTS_DIR/coding/clarify.template.md" "prompts/coding/clarify.template.md"
|
||||
validate_file_exists "$PROMPTS_DIR/coding/review.template.md" "prompts/coding/review.template.md"
|
||||
validate_file_exists "$PROMPTS_DIR/coding/verify-change.template.md" "prompts/coding/verify-change.template.md"
|
||||
validate_file_exists "$PROMPTS_DIR/coding/close-task.template.md" "prompts/coding/close-task.template.md"
|
||||
validate_file_exists "$PROMPTS_DIR/coding/update-memory.template.md" "prompts/coding/update-memory.template.md"
|
||||
validate_file_exists "$PROMPTS_DIR/coding/code-review.template.md" "prompts/coding/code-review.template.md"
|
||||
validate_file_exists "$PROMPTS_DIR/meta/prompt-generator.template.md" "prompts/meta/prompt-generator.template.md"
|
||||
|
||||
echo ""
|
||||
|
||||
|
||||
@@ -53,17 +53,21 @@ validate_toml_syntax() {
|
||||
|
||||
if python3 << EOF
|
||||
import sys
|
||||
try:
|
||||
import tomli
|
||||
except ImportError:
|
||||
parser = None
|
||||
for module_name in ("tomli", "tomllib", "toml"):
|
||||
try:
|
||||
import tomllib as tomli
|
||||
parser = __import__(module_name)
|
||||
break
|
||||
except ImportError:
|
||||
import toml as tomli
|
||||
continue
|
||||
|
||||
if parser is None:
|
||||
print("缺少 TOML 解析器(需要 tomli、tomllib 或 toml)", file=sys.stderr)
|
||||
sys.exit(2)
|
||||
|
||||
try:
|
||||
with open("$file", "rb") as f:
|
||||
tomli.load(f)
|
||||
parser.load(f)
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
print(f"TOML 语法错误: {e}", file=sys.stderr)
|
||||
@@ -74,8 +78,14 @@ EOF
|
||||
VALIDATION_PASSED=$((VALIDATION_PASSED + 1))
|
||||
return 0
|
||||
else
|
||||
echo " ❌ $description: TOML 语法错误"
|
||||
echo "TOML 语法错误: $file" >> "$ERRORS_FILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 2 ]; then
|
||||
echo " ❌ $description: 缺少 TOML 解析器"
|
||||
echo "缺少 TOML 解析器: $file" >> "$ERRORS_FILE"
|
||||
else
|
||||
echo " ❌ $description: TOML 语法错误"
|
||||
echo "TOML 语法错误: $file" >> "$ERRORS_FILE"
|
||||
fi
|
||||
VALIDATION_FAILED=$((VALIDATION_FAILED + 1))
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user