scripts/identifier_validation.py
scripts/identifier_validation.pyBrowse 11 files
184 tokens
784 bytes
Token encoding: o200k_base
Snapshot 18d7ace
← Back to SKILL.md
1"""Validate plugin and marketplace identifiers before using them in commands."""2 3import re4 5 6def validate_plugin_identifier(plugin_name: str) -> None:7 if re.fullmatch(r"[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*", plugin_name) is None:8 raise ValueError(9 "Plugin name may only contain ASCII letters, digits, `.`, `_`, and `-`, "10 "with dots separating non-empty name segments."11 )12 13 14def validate_marketplace_name(marketplace_name: str) -> None:15 if not marketplace_name:16 raise ValueError("Marketplace name must include at least one letter or digit.")17 if re.fullmatch(r"[A-Za-z0-9_-]+", marketplace_name) is None:18 raise ValueError(19 "Marketplace name may only contain ASCII letters, digits, `_`, and `-`."20 )21 