Skip to content

Commit

Permalink
Merge pull request #1714 from imjasonh/bump-quotes
Browse files Browse the repository at this point in the history
bump: double-quote bumped version strings, avoid trailing newline
  • Loading branch information
imjasonh authored Dec 16, 2024
2 parents 1b3b064 + 4ad654e commit 580944a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/renovate/bump/bump.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ func New(ctx context.Context, opts ...Option) renovate.Renovator {
epochNode.Value = fmt.Sprintf("%d", epoch+1)
}

versionNode.Value = bcfg.TargetVersion
versionNode.Style = yaml.FlowStyle
versionNode.Value = strings.TrimSpace(bcfg.TargetVersion)
versionNode.Style = yaml.DoubleQuotedStyle
versionNode.Tag = "!!str"

rc.Vars[config.SubstitutionPackageVersion] = bcfg.TargetVersion
Expand Down
6 changes: 3 additions & 3 deletions pkg/renovate/bump/bump_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ func TestBump_versions(t *testing.T) {
newVersion string
expectedVersion string
}{
{name: "float_issue.yaml", newVersion: "7.0.1", expectedVersion: "version: 7.0.1"},
{name: "quoted.yaml", newVersion: "7.0.1", expectedVersion: "version: 7.0.1"},
{name: "major_minor_patch.yaml", newVersion: "7.0.1", expectedVersion: "version: 7.0.1"},
{name: "float_issue.yaml", newVersion: "7.0.1", expectedVersion: `version: "7.0.1"`},
{name: "quoted.yaml", newVersion: "7.0.1", expectedVersion: `version: "7.0.1"`},
{name: "major_minor_patch.yaml", newVersion: "7.0.1", expectedVersion: `version: "7.0.1"`},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 580944a

Please sign in to comment.