mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-05 12:10:37 +00:00
Warn less about flag
This commit is contained in:
parent
70ac3d6c7a
commit
f35e57d901
@ -6,6 +6,8 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var showMergeAnchorToSpecWarning = true
|
||||||
|
|
||||||
func assignAliasOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
func assignAliasOperator(d *dataTreeNavigator, context Context, expressionNode *ExpressionNode) (Context, error) {
|
||||||
|
|
||||||
log.Debugf("AssignAlias operator!")
|
log.Debugf("AssignAlias operator!")
|
||||||
@ -159,8 +161,9 @@ func reconstructAliasedMap(node *CandidateNode, context Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else if showMergeAnchorToSpecWarning {
|
||||||
log.Warning("--yaml-fix-merge-anchor-to-spec is false; causing merge anchors to override the existing values which isn't to the yaml spec. This flag will default to true in late 2025.")
|
log.Warning("--yaml-fix-merge-anchor-to-spec is false; causing merge anchors to override the existing values which isn't to the yaml spec. This flag will default to true in late 2025.")
|
||||||
|
showMergeAnchorToSpecWarning = false
|
||||||
}
|
}
|
||||||
|
|
||||||
for index := 0; index < len(node.Content); index = index + 2 {
|
for index := 0; index < len(node.Content); index = index + 2 {
|
||||||
|
|||||||
@ -283,8 +283,6 @@ func doTraverseMap(newMatches *orderedmap.OrderedMap, node *CandidateNode, wante
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.Warning("--yaml-fix-merge-anchor-to-spec is false; causing merge anchors to override the existing values which isn't to the yaml spec. This flag will default to true in late 2025.")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,6 +294,10 @@ func doTraverseMap(newMatches *orderedmap.OrderedMap, node *CandidateNode, wante
|
|||||||
if key.Tag == "!!merge" && !prefs.DontFollowAlias && wantedKey != key.Value {
|
if key.Tag == "!!merge" && !prefs.DontFollowAlias && wantedKey != key.Value {
|
||||||
if !ConfiguredYamlPreferences.FixMergeAnchorToSpec {
|
if !ConfiguredYamlPreferences.FixMergeAnchorToSpec {
|
||||||
log.Debug("Merge anchor")
|
log.Debug("Merge anchor")
|
||||||
|
if showMergeAnchorToSpecWarning {
|
||||||
|
log.Warning("--yaml-fix-merge-anchor-to-spec is false; causing merge anchors to override the existing values which isn't to the yaml spec. This flag will default to true in late 2025.")
|
||||||
|
showMergeAnchorToSpecWarning = false
|
||||||
|
}
|
||||||
err := traverseMergeAnchor(newMatches, value, wantedKey, prefs, splat)
|
err := traverseMergeAnchor(newMatches, value, wantedKey, prefs, splat)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user