Merged
fix(hooks): remove duplicate NAME_PATTERN and MAX_NAME_LENGTH redefinitions in agents_linter.py #432
liangjinxuan-2026Add on 6 days ago
fix(hooks): remove duplicate NAME_PATTERN and MAX_NAME_LENGTH redefinitions in agents_linter.py #432
Merged
Total: 1 files changed+0-3
| @@ -10,7 +10,6 @@ | |||
| 10 | # ---------------------------------------------------------------------------------------------------------- | 10 | # ---------------------------------------------------------------------------------------------------------- |
| 11 | 11 | ||
| 12 | import logging | 12 | import logging |
| 13 | -import re | ||
| 14 | import sys | 13 | import sys |
| 15 | from pathlib import Path | 14 | from pathlib import Path |
| 16 | 15 | ||
| @@ -24,8 +23,6 @@ logger = logging.getLogger(__name__) | |||
| 24 | # 配置项 | 23 | # 配置项 |
| 25 | AGENTS_DIR = "./agents" | 24 | AGENTS_DIR = "./agents" |
| 26 | SKILLS_DIR = "./skills" | 25 | SKILLS_DIR = "./skills" |
| 27 | -NAME_PATTERN = re.compile(r'^[a-z0-9][a-z0-9\-]*$') # 小写字母、数字、连字符 | ||
| 28 | -MAX_NAME_LENGTH = 64 | ||
| 29 | 26 | ||
| 30 | 27 | ||
| 31 | def _check_skills_field(file_path: Path, skills) -> bool: | 28 | def _check_skills_field(file_path: Path, skills) -> bool: |
评审通过(代码层):移除与顶部 _yaml_utils import 遮蔽的本地重复定义 NAME_PATTERN/MAX_NAME_LENGTH(ruff F811;已核对 _yaml_utils 同名常量值逐字一致,语义不变)及未使用的 re 导入。CI 流水线尚未触发,合入前建议评论 /compile 触发确认。