feat: 固化 verb-noun-platform slug 命名规范与语义校验
All checks were successful
技能自动化发布 / release (push) Successful in 6s
All checks were successful
技能自动化发布 / release (push) Successful in 6s
This commit is contained in:
@@ -18,6 +18,7 @@ from db.display_metadata import (
|
||||
)
|
||||
from db.timestamp_columns import has_updated_at_trigger
|
||||
from util.constants import SKILL_SLUG
|
||||
from util.slug_naming import LEGACY_EXEMPT_SLUGS, validate_slug_semantics
|
||||
|
||||
_TEMPLATE_PLACEHOLDER_SLUGS = frozenset({"your-skill-slug", "your_skill_slug"})
|
||||
_ENGLISH_PLACEHOLDER_NAME_PATTERNS = (
|
||||
@@ -127,6 +128,14 @@ def validate_skill_frontmatter(skill_root: str, *, allow_template_placeholders:
|
||||
f"SKILL.md slug ({slug!r}) 与 util.constants.SKILL_SLUG ({constants_slug!r}) 不一致"
|
||||
)
|
||||
|
||||
if slug and slug not in LEGACY_EXEMPT_SLUGS and _KEBAB_SLUG.fullmatch(slug):
|
||||
naming_errors, naming_warnings = validate_slug_semantics(
|
||||
slug,
|
||||
strict=not allow_template_placeholders,
|
||||
)
|
||||
report.errors.extend(naming_errors)
|
||||
report.warnings.extend(naming_warnings)
|
||||
|
||||
return report
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user