diff options
Diffstat (limited to 'vendor')
29 files changed, 207 insertions, 62 deletions
diff --git a/vendor/github.com/google/yamlfmt/Makefile b/vendor/github.com/google/yamlfmt/Makefile index 2790ae3..9993d6d 100644 --- a/vendor/github.com/google/yamlfmt/Makefile +++ b/vendor/github.com/google/yamlfmt/Makefile @@ -15,7 +15,12 @@ test: .PHONY: test_v test_v: - go test -v ./... + @go test -v $$(go list ./... | grep -v "pkg/yaml") + @go test ./pkg/yaml/formattest + +.PHONY: vet +vet: + go vet $$(go list ./... | grep -v "pkg/yaml") YAMLFMT_BIN ?= $(shell pwd)/dist/yamlfmt .PHONY: integrationtest @@ -36,7 +41,7 @@ integrationtest_stdout: .PHONY: integrationtest_update integrationtest_update: $(MAKE) build - go test -tags=integration_test ./integrationtest/command -update + go test -tags=integration_test -v ./integrationtest/command -update .PHONY: command_test_case command_test_case: @@ -53,10 +58,12 @@ install: install_tools: go install github.com/google/addlicense@latest +ADDLICENSE = addlicense -ignore "**/testdata/**" -ignore "**/pkg/yaml/**" -c "Google LLC" -l apache + .PHONY: addlicense addlicense: - addlicense -ignore "**/testdata/**" -c "Google LLC" -l apache . + $(ADDLICENSE) . .PHONY: addlicense_check addlicense_check: - addlicense -check -ignore "**/testdata/**" -c "Google LLC" -l apache . + $(ADDLICENSE) -check . diff --git a/vendor/github.com/google/yamlfmt/command/command.go b/vendor/github.com/google/yamlfmt/command/command.go index 3224f46..1204b94 100644 --- a/vendor/github.com/google/yamlfmt/command/command.go +++ b/vendor/github.com/google/yamlfmt/command/command.go @@ -23,9 +23,8 @@ import ( "github.com/google/yamlfmt" "github.com/google/yamlfmt/engine" + "github.com/google/yamlfmt/pkg/yaml" "github.com/mitchellh/mapstructure" - - "github.com/braydonk/yaml" ) type FormatterConfig struct { @@ -58,6 +57,7 @@ type Command struct { Registry *yamlfmt.Registry Config *Config Quiet bool + Verbose bool } func (c *Command) Run() error { @@ -75,6 +75,7 @@ func (c *Command) Run() error { LineSepCharacter: lineSepChar, Formatter: formatter, Quiet: c.Quiet, + Verbose: c.Verbose, ContinueOnError: c.Config.ContinueOnError, OutputFormat: c.Config.OutputFormat, } diff --git a/vendor/github.com/google/yamlfmt/engine.go b/vendor/github.com/google/yamlfmt/engine.go index b98ee89..bd43f0c 100644 --- a/vendor/github.com/google/yamlfmt/engine.go +++ b/vendor/github.com/google/yamlfmt/engine.go @@ -17,6 +17,7 @@ package yamlfmt import ( "fmt" "os" + "slices" "github.com/google/yamlfmt/internal/collections" "github.com/google/yamlfmt/internal/multilinediff" @@ -88,7 +89,9 @@ func (fds FileDiffs) Add(diff *FileDiff) error { func (fds FileDiffs) StrOutput() string { result := "" - for _, fd := range fds { + sortedPaths := fds.sortedPaths() + for _, path := range sortedPaths { + fd := fds[path] if fd.Diff.Changed() { result += fd.StrOutput() } @@ -98,7 +101,9 @@ func (fds FileDiffs) StrOutput() string { func (fds FileDiffs) StrOutputQuiet() string { result := "" - for _, fd := range fds { + sortedPaths := fds.sortedPaths() + for _, path := range sortedPaths { + fd := fds[path] if fd.Diff.Changed() { result += fd.StrOutputQuiet() } @@ -125,3 +130,12 @@ func (fds FileDiffs) ChangedCount() int { } return changed } + +func (fds FileDiffs) sortedPaths() []string { + pathKeys := []string{} + for path := range fds { + pathKeys = append(pathKeys, path) + } + slices.Sort(pathKeys) + return pathKeys +} diff --git a/vendor/github.com/google/yamlfmt/engine/consecutive_engine.go b/vendor/github.com/google/yamlfmt/engine/consecutive_engine.go index 650d1b7..1ec241a 100644 --- a/vendor/github.com/google/yamlfmt/engine/consecutive_engine.go +++ b/vendor/github.com/google/yamlfmt/engine/consecutive_engine.go @@ -19,15 +19,17 @@ import ( "os" "github.com/google/yamlfmt" + "github.com/google/yamlfmt/internal/logger" ) // Engine that will process each file one by one consecutively. type ConsecutiveEngine struct { LineSepCharacter string Formatter yamlfmt.Formatter - Quiet bool ContinueOnError bool OutputFormat EngineOutputFormat + Quiet bool + Verbose bool } func (e *ConsecutiveEngine) FormatContent(content []byte) ([]byte, error) { @@ -36,6 +38,13 @@ func (e *ConsecutiveEngine) FormatContent(content []byte) ([]byte, error) { func (e *ConsecutiveEngine) Format(paths []string) (fmt.Stringer, error) { formatDiffs, formatErrs := e.formatAll(paths) + + // Debug format diff output. + logger.Debug( + logger.DebugCodeDiffs, + fmt.Sprintf("The following files were modified:\n%s", formatDiffs.StrOutput()), + ) + if len(formatErrs) > 0 { if e.ContinueOnError { fmt.Print(formatErrs) @@ -44,7 +53,11 @@ func (e *ConsecutiveEngine) Format(paths []string) (fmt.Stringer, error) { return nil, formatErrs } } - return nil, formatDiffs.ApplyAll() + applyErr := formatDiffs.ApplyAll() + if applyErr != nil { + return nil, applyErr + } + return getEngineOutput(e.OutputFormat, yamlfmt.OperationFormat, formatDiffs, e.Quiet, e.Verbose) } func (e *ConsecutiveEngine) Lint(paths []string) (fmt.Stringer, error) { @@ -55,7 +68,7 @@ func (e *ConsecutiveEngine) Lint(paths []string) (fmt.Stringer, error) { if formatDiffs.ChangedCount() == 0 { return nil, nil } - return getEngineOutput(e.OutputFormat, yamlfmt.OperationLint, formatDiffs, e.Quiet) + return getEngineOutput(e.OutputFormat, yamlfmt.OperationLint, formatDiffs, e.Quiet, e.Verbose) } func (e *ConsecutiveEngine) DryRun(paths []string) (fmt.Stringer, error) { @@ -66,7 +79,7 @@ func (e *ConsecutiveEngine) DryRun(paths []string) (fmt.Stringer, error) { if formatDiffs.ChangedCount() == 0 { return nil, nil } - return getEngineOutput(e.OutputFormat, yamlfmt.OperationDry, formatDiffs, e.Quiet) + return getEngineOutput(e.OutputFormat, yamlfmt.OperationDry, formatDiffs, e.Quiet, e.Verbose) } func (e *ConsecutiveEngine) formatAll(paths []string) (yamlfmt.FileDiffs, FormatErrors) { diff --git a/vendor/github.com/google/yamlfmt/engine/output.go b/vendor/github.com/google/yamlfmt/engine/output.go index 2d35e84..c6a2e9e 100644 --- a/vendor/github.com/google/yamlfmt/engine/output.go +++ b/vendor/github.com/google/yamlfmt/engine/output.go @@ -32,10 +32,10 @@ const ( EngineOutputGitlab EngineOutputFormat = "gitlab" ) -func getEngineOutput(t EngineOutputFormat, operation yamlfmt.Operation, files yamlfmt.FileDiffs, quiet bool) (fmt.Stringer, error) { +func getEngineOutput(t EngineOutputFormat, operation yamlfmt.Operation, files yamlfmt.FileDiffs, quiet bool, verbose bool) (fmt.Stringer, error) { switch t { case EngineOutputDefault: - return engineOutput{Operation: operation, Files: files, Quiet: quiet}, nil + return engineOutput{Operation: operation, Files: files, Quiet: quiet, Verbose: verbose}, nil case EngineOutputSingeLine: return engineOutputSingleLine{Operation: operation, Files: files, Quiet: quiet}, nil case EngineOutputGitlab: @@ -49,11 +49,21 @@ type engineOutput struct { Operation yamlfmt.Operation Files yamlfmt.FileDiffs Quiet bool + Verbose bool } func (eo engineOutput) String() string { var msg string switch eo.Operation { + case yamlfmt.OperationFormat: + // Formatting only produces output in verbose mode. + if !eo.Verbose { + return "" + } + + msg = "The following files were modified:\n" + msg += eo.Files.StrOutputQuiet() + return msg case yamlfmt.OperationLint: msg = "The following formatting differences were found:" if eo.Quiet { @@ -65,7 +75,7 @@ func (eo engineOutput) String() string { msg = "The following files would be formatted:" } } else { - return "No files will formatted." + return "No files will be formatted." } } var result string diff --git a/vendor/github.com/google/yamlfmt/formatters/basic/config.go b/vendor/github.com/google/yamlfmt/formatters/basic/config.go index 82e67eb..2a32d05 100644 --- a/vendor/github.com/google/yamlfmt/formatters/basic/config.go +++ b/vendor/github.com/google/yamlfmt/formatters/basic/config.go @@ -18,25 +18,28 @@ import ( "runtime" "github.com/google/yamlfmt" + yamlFeatures "github.com/google/yamlfmt/formatters/basic/features" ) type Config struct { - Indent int `mapstructure:"indent"` - IncludeDocumentStart bool `mapstructure:"include_document_start"` - LineEnding yamlfmt.LineBreakStyle `mapstructure:"line_ending"` - LineLength int `mapstructure:"max_line_length"` - RetainLineBreaks bool `mapstructure:"retain_line_breaks"` - RetainLineBreaksSingle bool `mapstructure:"retain_line_breaks_single"` - DisallowAnchors bool `mapstructure:"disallow_anchors"` - ScanFoldedAsLiteral bool `mapstructure:"scan_folded_as_literal"` - IndentlessArrays bool `mapstructure:"indentless_arrays"` - DropMergeTag bool `mapstructure:"drop_merge_tag"` - PadLineComments int `mapstructure:"pad_line_comments"` - TrimTrailingWhitespace bool `mapstructure:"trim_trailing_whitespace"` - EOFNewline bool `mapstructure:"eof_newline"` - StripDirectives bool `mapstructure:"strip_directives"` - ArrayIndent int `mapstructure:"array_indent"` - IndentRootArray bool `mapstructure:"indent_root_array"` + Indent int `mapstructure:"indent"` + IncludeDocumentStart bool `mapstructure:"include_document_start"` + LineEnding yamlfmt.LineBreakStyle `mapstructure:"line_ending"` + LineLength int `mapstructure:"max_line_length"` + RetainLineBreaks bool `mapstructure:"retain_line_breaks"` + RetainLineBreaksSingle bool `mapstructure:"retain_line_breaks_single"` + DisallowAnchors bool `mapstructure:"disallow_anchors"` + ScanFoldedAsLiteral bool `mapstructure:"scan_folded_as_literal"` + IndentlessArrays bool `mapstructure:"indentless_arrays"` + DropMergeTag bool `mapstructure:"drop_merge_tag"` + PadLineComments int `mapstructure:"pad_line_comments"` + TrimTrailingWhitespace bool `mapstructure:"trim_trailing_whitespace"` + EOFNewline bool `mapstructure:"eof_newline"` + StripDirectives bool `mapstructure:"strip_directives"` + ArrayIndent int `mapstructure:"array_indent"` + IndentRootArray bool `mapstructure:"indent_root_array"` + DisableAliasKeyCorrection bool `mapstructure:"disable_alias_key_correction"` + ForceArrayStyle yamlFeatures.SequenceStyle `mapstructure:"force_array_style"` } func DefaultConfig() *Config { diff --git a/vendor/github.com/google/yamlfmt/formatters/basic/features.go b/vendor/github.com/google/yamlfmt/formatters/basic/features.go index de736f4..fc933f4 100644 --- a/vendor/github.com/google/yamlfmt/formatters/basic/features.go +++ b/vendor/github.com/google/yamlfmt/formatters/basic/features.go @@ -15,9 +15,8 @@ package basic import ( - "github.com/braydonk/yaml" "github.com/google/yamlfmt" - "github.com/google/yamlfmt/formatters/basic/anchors" + yamlFeatures "github.com/google/yamlfmt/formatters/basic/features" "github.com/google/yamlfmt/internal/features" "github.com/google/yamlfmt/internal/hotfix" ) @@ -55,24 +54,19 @@ func ConfigureFeaturesFromConfig(config *Config) yamlfmt.FeatureList { return configuredFeatures } -// These features will directly use the `yaml.Node` type and -// as such are specific to this formatter. -type YAMLFeatureFunc func(yaml.Node) error -type YAMLFeatureList []YAMLFeatureFunc +func ConfigureYAMLFeaturesFromConfig(config *Config) yamlFeatures.YAMLFeatureList { + var featureList yamlFeatures.YAMLFeatureList -func (y YAMLFeatureList) ApplyFeatures(node yaml.Node) error { - for _, f := range y { - if err := f(node); err != nil { - return err - } + if config.DisallowAnchors { + featureList = append(featureList, yamlFeatures.Check) } - return nil -} -func ConfigureYAMLFeaturesFromConfig(config *Config) YAMLFeatureList { - var features YAMLFeatureList - if config.DisallowAnchors { - features = append(features, anchors.Check) + if config.ForceArrayStyle != "" { + featureList = append( + featureList, + yamlFeatures.FeatureForceSequenceStyle(config.ForceArrayStyle), + ) } - return features + + return featureList } diff --git a/vendor/github.com/google/yamlfmt/formatters/basic/anchors/check.go b/vendor/github.com/google/yamlfmt/formatters/basic/features/check.go index aef3070..368de5c 100644 --- a/vendor/github.com/google/yamlfmt/formatters/basic/anchors/check.go +++ b/vendor/github.com/google/yamlfmt/formatters/basic/features/check.go @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -package anchors +package features import ( "errors" "fmt" - "github.com/braydonk/yaml" + "github.com/google/yamlfmt/pkg/yaml" ) func Check(n yaml.Node) error { diff --git a/vendor/github.com/google/yamlfmt/formatters/basic/features/force_sequence.go b/vendor/github.com/google/yamlfmt/formatters/basic/features/force_sequence.go new file mode 100644 index 0000000..f3f956c --- /dev/null +++ b/vendor/github.com/google/yamlfmt/formatters/basic/features/force_sequence.go @@ -0,0 +1,43 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package features + +import "github.com/google/yamlfmt/pkg/yaml" + +type SequenceStyle string + +const ( + SequenceStyleBlock SequenceStyle = "block" + SequenceStyleFlow SequenceStyle = "flow" +) + +func FeatureForceSequenceStyle(style SequenceStyle) YAMLFeatureFunc { + var styleVal yaml.Style + if style == SequenceStyleFlow { + styleVal = yaml.FlowStyle + } + var forceStyle YAMLFeatureFunc + forceStyle = func(n yaml.Node) error { + var err error + for _, c := range n.Content { + if c.Kind == yaml.SequenceNode { + c.Style = styleVal + } + err = forceStyle(*c) + } + return err + } + return forceStyle +} diff --git a/vendor/github.com/google/yamlfmt/formatters/basic/features/yaml_feature.go b/vendor/github.com/google/yamlfmt/formatters/basic/features/yaml_feature.go new file mode 100644 index 0000000..2657a53 --- /dev/null +++ b/vendor/github.com/google/yamlfmt/formatters/basic/features/yaml_feature.go @@ -0,0 +1,31 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package features + +import "github.com/google/yamlfmt/pkg/yaml" + +// These features will directly use the `yaml.Node` type and +// as such are specific to this formatter. +type YAMLFeatureFunc func(yaml.Node) error +type YAMLFeatureList []YAMLFeatureFunc + +func (y YAMLFeatureList) ApplyFeatures(node yaml.Node) error { + for _, f := range y { + if err := f(node); err != nil { + return err + } + } + return nil +} diff --git a/vendor/github.com/google/yamlfmt/formatters/basic/formatter.go b/vendor/github.com/google/yamlfmt/formatters/basic/formatter.go index 26bcc45..1e69bdb 100644 --- a/vendor/github.com/google/yamlfmt/formatters/basic/formatter.go +++ b/vendor/github.com/google/yamlfmt/formatters/basic/formatter.go @@ -20,8 +20,9 @@ import ( "errors" "io" - "github.com/braydonk/yaml" "github.com/google/yamlfmt" + yamlFeature "github.com/google/yamlfmt/formatters/basic/features" + "github.com/google/yamlfmt/pkg/yaml" "github.com/mitchellh/mapstructure" ) @@ -30,7 +31,7 @@ const BasicFormatterType string = "basic" type BasicFormatter struct { Config *Config Features yamlfmt.FeatureList - YAMLFeatures YAMLFeatureList + YAMLFeatures yamlFeature.YAMLFeatureList } // yamlfmt.Formatter interface @@ -63,6 +64,10 @@ func (f *BasicFormatter) Format(input []byte) ([]byte, error) { documents = append(documents, docNode) } + if len(documents) == 0 { + return input, nil + } + // Run all YAML features. for _, d := range documents { if err := f.YAMLFeatures.ApplyFeatures(d); err != nil { @@ -119,6 +124,13 @@ func (f *BasicFormatter) getNewEncoder(buf *bytes.Buffer) *yaml.Encoder { } e.SetIndentRootArray(f.Config.IndentRootArray) + // Yes I know I could SetCorrectAliasKeys(!f.Config.DisableAliasKeyCorrection) + // but I know myself and I know I'll get confused and have to go look up + // the source again next time I look and forget. + if !f.Config.DisableAliasKeyCorrection { + e.SetCorrectAliasKeys(true) + } + return e } diff --git a/vendor/github.com/google/yamlfmt/internal/logger/debug.go b/vendor/github.com/google/yamlfmt/internal/logger/debug.go index a75463c..5a82c3c 100644 --- a/vendor/github.com/google/yamlfmt/internal/logger/debug.go +++ b/vendor/github.com/google/yamlfmt/internal/logger/debug.go @@ -26,13 +26,15 @@ const ( DebugCodeAny DebugCode = iota DebugCodeConfig DebugCodePaths + DebugCodeDiffs ) var ( supportedDebugCodes = map[string][]DebugCode{ "config": {DebugCodeConfig}, "paths": {DebugCodePaths}, - "all": {DebugCodeConfig, DebugCodePaths}, + "diffs": {DebugCodeDiffs}, + "all": {DebugCodeConfig, DebugCodePaths, DebugCodeDiffs}, } activeDebugCodes = collections.Set[DebugCode]{} ) diff --git a/vendor/github.com/braydonk/yaml/LICENSE b/vendor/github.com/google/yamlfmt/pkg/yaml/LICENSE index 2683e4b..2683e4b 100644 --- a/vendor/github.com/braydonk/yaml/LICENSE +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/LICENSE diff --git a/vendor/github.com/braydonk/yaml/NOTICE b/vendor/github.com/google/yamlfmt/pkg/yaml/NOTICE index 866d74a..866d74a 100644 --- a/vendor/github.com/braydonk/yaml/NOTICE +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/NOTICE diff --git a/vendor/github.com/braydonk/yaml/README.md b/vendor/github.com/google/yamlfmt/pkg/yaml/README.md index 3a9ddf3..105ee6b 100644 --- a/vendor/github.com/braydonk/yaml/README.md +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/README.md @@ -1,4 +1,4 @@ -# YAML support for the Go language +# The Artist formerly known as gopkg.in/yaml.v3 FORK ------------ diff --git a/vendor/github.com/braydonk/yaml/apic.go b/vendor/github.com/google/yamlfmt/pkg/yaml/apic.go index 76cc0e4..e58b481 100644 --- a/vendor/github.com/braydonk/yaml/apic.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/apic.go @@ -214,6 +214,11 @@ func yaml_emitter_set_pad_line_comments(emitter *yaml_emitter_t, pad_line_commen emitter.pad_line_comments = pad_line_comments } +// Set correct alias keys. +func yaml_emitter_set_correct_alias_keys(emitter *yaml_emitter_t, correct_alias_keys bool) { + emitter.correct_alias_keys = correct_alias_keys +} + ///* // * Destroy a token object. // */ diff --git a/vendor/github.com/braydonk/yaml/decode.go b/vendor/github.com/google/yamlfmt/pkg/yaml/decode.go index 0173b69..0173b69 100644 --- a/vendor/github.com/braydonk/yaml/decode.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/decode.go diff --git a/vendor/github.com/braydonk/yaml/emitterc.go b/vendor/github.com/google/yamlfmt/pkg/yaml/emitterc.go index 6a93554..3a1aede 100644 --- a/vendor/github.com/braydonk/yaml/emitterc.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/emitterc.go @@ -888,7 +888,7 @@ func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, switch event.typ { case yaml_ALIAS_EVENT: - return yaml_emitter_emit_alias(emitter, event) + return yaml_emitter_emit_alias(emitter) case yaml_SCALAR_EVENT: return yaml_emitter_emit_scalar(emitter, event) case yaml_SEQUENCE_START_EVENT: @@ -902,10 +902,16 @@ func yaml_emitter_emit_node(emitter *yaml_emitter_t, event *yaml_event_t, } // Expect ALIAS. -func yaml_emitter_emit_alias(emitter *yaml_emitter_t, event *yaml_event_t) bool { +func yaml_emitter_emit_alias(emitter *yaml_emitter_t) bool { if !yaml_emitter_process_anchor(emitter) { return false } + if emitter.correct_alias_keys && emitter.simple_key_context && + len(emitter.states) > 1 && emitter.states[len(emitter.states)-2] == yaml_EMIT_BLOCK_MAPPING_KEY_STATE { + if !put(emitter, ' ') { + return false + } + } emitter.state = emitter.states[len(emitter.states)-1] emitter.states = emitter.states[:len(emitter.states)-1] return true diff --git a/vendor/github.com/braydonk/yaml/encode.go b/vendor/github.com/google/yamlfmt/pkg/yaml/encode.go index ba1c854..ba1c854 100644 --- a/vendor/github.com/braydonk/yaml/encode.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/encode.go diff --git a/vendor/github.com/braydonk/yaml/parserc.go b/vendor/github.com/google/yamlfmt/pkg/yaml/parserc.go index 23f3d6a..23f3d6a 100644 --- a/vendor/github.com/braydonk/yaml/parserc.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/parserc.go diff --git a/vendor/github.com/braydonk/yaml/readerc.go b/vendor/github.com/google/yamlfmt/pkg/yaml/readerc.go index b7de0a8..b7de0a8 100644 --- a/vendor/github.com/braydonk/yaml/readerc.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/readerc.go diff --git a/vendor/github.com/braydonk/yaml/resolve.go b/vendor/github.com/google/yamlfmt/pkg/yaml/resolve.go index 64ae888..64ae888 100644 --- a/vendor/github.com/braydonk/yaml/resolve.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/resolve.go diff --git a/vendor/github.com/braydonk/yaml/scannerc.go b/vendor/github.com/google/yamlfmt/pkg/yaml/scannerc.go index 7faa856..7faa856 100644 --- a/vendor/github.com/braydonk/yaml/scannerc.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/scannerc.go diff --git a/vendor/github.com/braydonk/yaml/sorter.go b/vendor/github.com/google/yamlfmt/pkg/yaml/sorter.go index 9210ece..9210ece 100644 --- a/vendor/github.com/braydonk/yaml/sorter.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/sorter.go diff --git a/vendor/github.com/braydonk/yaml/writerc.go b/vendor/github.com/google/yamlfmt/pkg/yaml/writerc.go index b8a116b..b8a116b 100644 --- a/vendor/github.com/braydonk/yaml/writerc.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/writerc.go diff --git a/vendor/github.com/braydonk/yaml/yaml.go b/vendor/github.com/google/yamlfmt/pkg/yaml/yaml.go index b336163..5fcdc1a 100644 --- a/vendor/github.com/braydonk/yaml/yaml.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/yaml.go @@ -343,6 +343,11 @@ func (e *Encoder) SetPadLineComments(padLineComments int) { yaml_emitter_set_pad_line_comments(&e.encoder.emitter, padLineComments) } +// SetCorrectAliasKeys enables alias key syntax correction. +func (e *Encoder) SetCorrectAliasKeys(correctAliasKeys bool) { + yaml_emitter_set_correct_alias_keys(&e.encoder.emitter, correctAliasKeys) +} + // Close closes the encoder by writing any remaining data. // It does not write a stream terminating string "...". func (e *Encoder) Close() (err error) { diff --git a/vendor/github.com/braydonk/yaml/yamlh.go b/vendor/github.com/google/yamlfmt/pkg/yaml/yamlh.go index 92ab866..a8ccef7 100644 --- a/vendor/github.com/braydonk/yaml/yamlh.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/yamlh.go @@ -741,6 +741,7 @@ type yaml_emitter_t struct { explicit_document_start bool // Force an explicit document start assume_folded_as_literal bool // Assume blocks were scanned as literals pad_line_comments int // The number of spaces to insert before line comments. + correct_alias_keys bool // Whether to correct alias nodes used as map keys. state yaml_emitter_state_t // The current emitter state. states []yaml_emitter_state_t // The stack of states. diff --git a/vendor/github.com/braydonk/yaml/yamlprivateh.go b/vendor/github.com/google/yamlfmt/pkg/yaml/yamlprivateh.go index 50e1532..50e1532 100644 --- a/vendor/github.com/braydonk/yaml/yamlprivateh.go +++ b/vendor/github.com/google/yamlfmt/pkg/yaml/yamlprivateh.go diff --git a/vendor/modules.txt b/vendor/modules.txt index 03fec83..4dab1c0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -276,9 +276,6 @@ github.com/bits-and-blooms/bloom/v3 # github.com/bmatcuk/doublestar/v4 v4.7.1 ## explicit; go 1.16 github.com/bmatcuk/doublestar/v4 -# github.com/braydonk/yaml v0.9.0 -## explicit; go 1.11 -github.com/braydonk/yaml # github.com/bufbuild/protocompile v0.14.1 ## explicit; go 1.21 github.com/bufbuild/protocompile @@ -560,20 +557,21 @@ github.com/google/jsonapi # github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid -# github.com/google/yamlfmt v0.16.0 +# github.com/google/yamlfmt v0.17.2 ## explicit; go 1.21 github.com/google/yamlfmt github.com/google/yamlfmt/cmd/yamlfmt github.com/google/yamlfmt/command github.com/google/yamlfmt/engine github.com/google/yamlfmt/formatters/basic -github.com/google/yamlfmt/formatters/basic/anchors +github.com/google/yamlfmt/formatters/basic/features github.com/google/yamlfmt/internal/collections github.com/google/yamlfmt/internal/features github.com/google/yamlfmt/internal/gitlab github.com/google/yamlfmt/internal/hotfix github.com/google/yamlfmt/internal/logger github.com/google/yamlfmt/internal/multilinediff +github.com/google/yamlfmt/pkg/yaml # github.com/gookit/color v1.5.4 ## explicit; go 1.18 github.com/gookit/color |
