Skip to content

fix: use 2-space indentation in generated compose.yaml#461

Merged
mathieu-benoit merged 3 commits intomainfrom
copilot/fix-indentation-in-compose-yaml
Apr 13, 2026
Merged

fix: use 2-space indentation in generated compose.yaml#461
mathieu-benoit merged 3 commits intomainfrom
copilot/fix-indentation-in-compose-yaml

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

Description

Switch the generate command from using yaml.Marshal (which produces 4-space indented output) to compose.WriteYAML with SetIndent(2), so that the generated compose.yaml uses standard 2-space indentation. Update all test expected outputs to match the new 2-space format.

What does this PR do?

The generate command previously used yaml.Marshal to serialise the Compose project, which produced 4-space indented YAML. This PR replaces that call with compose.WriteYAML (backed by SetIndent(2)), aligning the generated compose.yaml output with the conventional 2-space indentation used across the Compose ecosystem. All affected golden-string expectations in generate_test.go, generate_examples_test.go, and init_test.go are updated accordingly.

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.

Agent-Logs-Url: https://github.com/score-spec/score-compose/sessions/ecaecef1-45e8-4406-a3a9-ff9e02fa1529

Co-authored-by: mathieu-benoit <11720844+mathieu-benoit@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 11, 2026

Overview

Image reference score-compose:latest score-compose:latest
- digest 4ceb43162d1e bd6d13e996a2
- tag latest latest
- provenance aa92490 021ea05
- vulnerabilities critical: 0 high: 0 medium: 0 low: 0 critical: 0 high: 0 medium: 0 low: 0
- platform linux/amd64 linux/amd64
- size 6.2 MB 6.2 MB (+850 B)
- packages 54 54
Policies (0 improved, 0 worsened)
Policy Name score-compose:latest score-compose:latest Change Standing
Default non-root user No Change
No AGPL v3 licenses No Change
No fixable critical or high vulnerabilities No Change
No high-profile vulnerabilities No Change
No outdated base images No Change
No unapproved base images No Change
Supply chain attestations No Change
Valid Docker Hardened Image (DHI) or DHI base image ⚠️ 2 ⚠️ 2 No Change
Packages and Vulnerabilities (1 package changes and 0 vulnerability changes)
  • ♾️ 1 packages changed
  • 53 packages unchanged
Changes for packages of type golang (1 changes)
Package Version
score-compose:latest
Version
score-compose:latest
♾️ github.com/score-spec/score-compose 0.0.0-20260412232642-aa924900c12b+dirty 0.0.0-20260412233125-021ea05909f4+dirty

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.

I wanted a cleaner output file with 2-spaces indentation instead of 4-spaces, this LGTM

@mathieu-benoit
Copy link
Copy Markdown
Contributor

mathieu-benoit commented Apr 11, 2026

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 346e1f1 into main Apr 13, 2026
16 checks passed
@mathieu-benoit mathieu-benoit deleted the copilot/fix-indentation-in-compose-yaml branch April 13, 2026 02:38
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