Skip to content

Commit

Permalink
brackets surrounding template name for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
ecrupper committed Feb 3, 2025
1 parent 91eeb44 commit 8e77637
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions compiler/native/expand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,10 @@ func TestNative_ExpandStepsWarnings(t *testing.T) {
}

wantWarnings := []string{
"warnings:25:duplicate << keys in single YAML map",
"warnings:32:duplicate << keys in single YAML map",
"warnings:44:duplicate << keys in single YAML map",
"warnings:43:duplicate << keys in single YAML map",
"[warnings]:25:duplicate << keys in single YAML map",
"[warnings]:32:duplicate << keys in single YAML map",
"[warnings]:44:duplicate << keys in single YAML map",
"[warnings]:43:duplicate << keys in single YAML map",
}

// run test
Expand Down
2 changes: 1 addition & 1 deletion internal/yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func ParseYAML(data []byte, tmplName string) (*types.Build, []string, error) {
)

if len(tmplName) > 0 {
warningPrefix = fmt.Sprintf("%s:", tmplName)
warningPrefix = fmt.Sprintf("[%s]:", tmplName)
}

err := yaml.Unmarshal(data, &rootNode)
Expand Down
2 changes: 1 addition & 1 deletion internal/yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestInternal_ParseYAML(t *testing.T) {
name: "anchor collapse - warning prefix",
file: "testdata/buildkite_new_version.yml",
wantBuild: wantBuild,
wantWarnings: []string{"prefix:16:duplicate << keys in single YAML map"},
wantWarnings: []string{"[prefix]:16:duplicate << keys in single YAML map"},
warningPrefix: "prefix",
},
{
Expand Down

0 comments on commit 8e77637

Please sign in to comment.