Skip to content

Commit

Permalink
rename rotationOnly -> rotateOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
nyobe committed Jan 29, 2025
1 parent c2b41ee commit 73169d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ast/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func (d *MapDecl[T]) parse(name string, node syntax.Node) syntax.Diagnostics {
type ImportMetaDecl struct {
declNode

Merge *BooleanExpr
RotationOnly *BooleanExpr
Merge *BooleanExpr
RotateOnly *BooleanExpr
}

func (d *ImportMetaDecl) recordSyntax() *syntax.Node {
Expand Down
8 changes: 4 additions & 4 deletions eval/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,9 @@ func (e *evalContext) evaluateImport(myImports map[string]*value, decl *ast.Impo
if decl.Meta != nil && decl.Meta.Merge != nil {
merge = decl.Meta.Merge.Value
}
rotationOnly := false
if decl.Meta != nil && decl.Meta.RotationOnly != nil {
rotationOnly = decl.Meta.RotationOnly.Value
rotateOnly := false
if decl.Meta != nil && decl.Meta.RotateOnly != nil {
rotateOnly = decl.Meta.RotateOnly.Value
}

var val *value
Expand All @@ -486,7 +486,7 @@ func (e *evalContext) evaluateImport(myImports map[string]*value, decl *ast.Impo
return
}
val = imported.value
} else if rotationOnly && !e.rotating {
} else if rotateOnly && !e.rotating {
// this import should only be evaluated during rotation, and we're not rotating, so resolve it as unknown
val = &value{def: newMissingExpr("", nil), schema: schema.Always(), unknown: true}
} else {
Expand Down
2 changes: 1 addition & 1 deletion eval/testdata/eval/import-rotate/env.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
imports:
- a: {merge: false, rotationOnly: true}
- a: {rotateOnly: true, merge: false}

values:
# expectation: example is unknown during open, but resolves during rotate
Expand Down

0 comments on commit 73169d2

Please sign in to comment.