Skip to content

Commit

Permalink
feat: improve the copy from checker
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdaclan committed Jul 30, 2024
1 parent 27e09fa commit 74d28bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion core/recipe.cue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ for i, stg in stages {
_stageIds: [for stg in stages {stg.id}]
for cp in stg.copy {
if cp.from != _|_ {
_validFrom: true & list.Contains(_stageIds, cp.from)
_noFromOnInitialStage: true & i != 0
_noFromSameStage: true & stg.id != cp.from
_noFromNextStage: true & _uniqueStageIds[cp.from] < i
_validFrom: true & list.Contains(_stageIds, cp.from)
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion example/play.cue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ for i, stg in stages {
_stageIds: [for stg in stages {stg.id}]
for cp in stg.copy {
if cp.from != _|_ {
_validFrom: true & list.Contains(_stageIds, cp.from)
_noFromOnInitialStage: true & i != 0
_noFromSameStage: true & stg.id != cp.from
_noFromNextStage: true & _uniqueStageIds[cp.from] < i
_validFrom: true & list.Contains(_stageIds, cp.from)
}
}
}
Expand Down

0 comments on commit 74d28bc

Please sign in to comment.