Skip to content

fix: use 2-space indentation in generated manifests YAML output#89

Merged
mathieu-benoit merged 2 commits intomainfrom
copilot/apply-similar-changes-from-pr-461
Apr 12, 2026
Merged

fix: use 2-space indentation in generated manifests YAML output#89
mathieu-benoit merged 2 commits intomainfrom
copilot/apply-similar-changes-from-pr-461

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

score-implementation-sample generate was emitting YAML manifests with 4-space indentation instead of the standard 2-space.

Description

The generate command was calling yaml.NewEncoder(out).Encode(manifest) directly, which uses gopkg.in/yaml.v3's default 4-space indentation.

Fix: Create the encoder separately and call enc.SetIndent(2) before encoding:

// Before
_ = yaml.NewEncoder(out).Encode(manifest)

// After
enc := yaml.NewEncoder(out)
enc.SetIndent(2)
_ = enc.Encode(manifest)

Test expectations in generate_test.go updated to reflect 2-space indentation.

This mirrors the fix applied in score-spec/score-compose#461.

What does this PR do?

Fixes 4-space indentation in YAML manifest output from score-implementation-sample generate, aligning it with standard YAML formatting conventions.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • New chore (expected functionality to be implemented)

Checklist:

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I've signed off with an email address that matches the commit author.

Copy link
Copy Markdown
Contributor

@mathieu-benoit mathieu-benoit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mathieu-benoit mathieu-benoit merged commit 990dc4b into main Apr 12, 2026
6 checks passed
@mathieu-benoit mathieu-benoit deleted the copilot/apply-similar-changes-from-pr-461 branch April 12, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants