Apply lilleman's answers: maintain-restoring items are defects ranked after security, the most specific goal only, the reshape as the only work, bar 0.1
This commit is contained in:
@@ -47,6 +47,8 @@ def parse_moves(id_: str, cell: str) -> Moves | Failure:
|
||||
goals = [goal for goal, _ in moves]
|
||||
if repeated := [goal for goal in goals if goals.count(goal) > 1]:
|
||||
return Failure(f"item {id_} cites goal {repeated[0]} twice; name each goal once")
|
||||
if nested := [(parent, goal) for parent in goals for goal in goals if goal.startswith(parent + ".")]:
|
||||
return Failure(f"item {id_} names goal {nested[0][0]} beside its sub-goal {nested[0][1]}; name only the most specific goal an item moves, and a parent only for a move none of its sub-goals covers")
|
||||
return moves
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user