descrip length check and fix
This commit is contained in:
@@ -41,6 +41,8 @@ EXCLUDE_DIRS = {"__pycache__", ".git"}
|
||||
EXCLUDE_NAMES = {".DS_Store"}
|
||||
EXCLUDE_SUFFIXES = {".pyc", ".pyo"}
|
||||
FIXED_DATE = (2026, 1, 1, 0, 0, 0) # stable timestamp for reproducible archives
|
||||
MAX_DESCRIPTION = 500 # plugin-marketplace cap: plugin.json "description" must be UNDER this
|
||||
# (it has silently regressed past the limit before — fail the build now)
|
||||
|
||||
_KEY_RE = re.compile(r'(DEFAULT_KEY\s*=\s*")([0-9a-fA-F]{16,})(")')
|
||||
|
||||
@@ -102,7 +104,14 @@ def main(argv: list[str] | None = None) -> int:
|
||||
return 1
|
||||
|
||||
manifest_path = SRC / ".claude-plugin" / "plugin.json"
|
||||
version = json.loads(manifest_path.read_text(encoding="utf-8"))["version"]
|
||||
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
|
||||
version = manifest["version"]
|
||||
desc = manifest.get("description", "")
|
||||
if len(desc) >= MAX_DESCRIPTION:
|
||||
print(f"build: plugin description is {len(desc)} chars — must be under "
|
||||
f"{MAX_DESCRIPTION} (marketplace cap). Trim \"description\" in {MANIFEST}.",
|
||||
file=sys.stderr)
|
||||
return 1
|
||||
files = included_files()
|
||||
arcnames = {p.relative_to(SRC).as_posix() for p in files}
|
||||
if MANIFEST not in arcnames:
|
||||
|
||||
Reference in New Issue
Block a user