feat(ship): clarify delivery stop semantics
This commit is contained in:
@@ -13,6 +13,7 @@ from ship_lib import (
|
||||
DELIVERY_STATE,
|
||||
KIND,
|
||||
SHIP_STATUS,
|
||||
STOP_AT,
|
||||
SOURCE_KIND,
|
||||
TASK_STATUS,
|
||||
check_ship_id,
|
||||
@@ -77,6 +78,17 @@ def validate_ship_dir(ship_dir: Path) -> list[str]:
|
||||
if not isinstance(data.get("title"), str) or not str(data.get("title")).strip():
|
||||
_issue(issues, "title 不能为空")
|
||||
|
||||
for path, value in (
|
||||
("stopAt", data.get("stopAt")),
|
||||
("delivery.stopAt", (data.get("delivery") or {}).get("stopAt")
|
||||
if isinstance(data.get("delivery"), dict) else None),
|
||||
):
|
||||
if value not in (None, "") and value not in STOP_AT:
|
||||
_issue(
|
||||
issues,
|
||||
f"{path} 无效: {value!r}({', '.join(sorted(STOP_AT))})",
|
||||
)
|
||||
|
||||
source = data.get("source")
|
||||
if source is not None:
|
||||
src = _mapping(source, "source", issues)
|
||||
|
||||
Reference in New Issue
Block a user