Skip to content

*: add --yaml-doc-header flag for YAML document separator#716

Open
eb4x wants to merge 1 commit into
coreos:mainfrom
eb4x:yaml-doc-header
Open

*: add --yaml-doc-header flag for YAML document separator#716
eb4x wants to merge 1 commit into
coreos:mainfrom
eb4x:yaml-doc-header

Conversation

@eb4x

@eb4x eb4x commented Jun 19, 2026

Copy link
Copy Markdown

Add an optional --yaml-doc-header flag that prepends the standard YAML document separator (---) to MachineConfig YAML output.

Add an optional --yaml-doc-header flag that prepends the standard YAML
document separator (---) to MachineConfig YAML output.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new YAMLDocumentHeader option (exposed via the --yaml-doc-header CLI flag) to prepend a YAML document separator (---) to the generated YAML output. The reviewer suggested writing the # Generated by Butane; do not edit header comment before the --- document separator, as placing file-level comments at the very top of the file is more standard in YAML.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread config/util/util.go
Comment on lines +164 to 167
if options.YAMLDocumentHeader {
yamlCfgBuf.WriteString("---\n")
}
yamlCfgBuf.WriteString("# Generated by Butane; do not edit\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Placing the # Generated by Butane; do not edit header comment at the very top of the file (before the --- document separator) is more standard for file-level comments in YAML. This ensures that the header is always on line 1, making it immediately visible to anyone opening the file.

Suggested change
if options.YAMLDocumentHeader {
yamlCfgBuf.WriteString("---\n")
}
yamlCfgBuf.WriteString("# Generated by Butane; do not edit\n")
yamlCfgBuf.WriteString("# Generated by Butane; do not edit\n")
if options.YAMLDocumentHeader {
yamlCfgBuf.WriteString("---\n")
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

They're both easily seen at the top, and if you're concatenating multiple yaml files, the comment is in the document it belongs in, not in the preceding one.

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.

1 participant