Skip to content

🔧 build(yaml): check out YAML with LF so yamlfmt passes on Windows - #620

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/yamlfmt-workflows
Oct 15, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/yamlfmt-workflows

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Running tox -e fix on a Windows checkout fails in the yamlfmt hook, as reported in #619: it inserts a blank line into check.yaml, prepare-release.yaml and release.yaml. 🐛 With core.autocrlf=true (the Git for Windows default), YAML files are checked out with CRLF. yamlfmt rewrites every file to LF, and given CRLF input it also adds a blank line after >- and | block scalars. Git's line-ending normalization hides the CRLF-to-LF change, so only those three files show up as modified.

A .gitattributes entry pins *.yaml and *.yml to eol=lf, so a Windows working tree holds the same bytes yamlfmt produces and the hook passes. Setting line_ending=crlf or retain_line_breaks=false in yamlfmt does not help, since both still modify the files.

Existing Windows clones keep their CRLF YAML files until those files are checked out again.

yamlfmt rewrites YAML to LF and, given CRLF input, inserts a blank line
after block scalars. Windows checkouts with core.autocrlf therefore fail
the fix hook on the three workflow files. Pinning eol=lf keeps the
working tree identical to what yamlfmt emits.
@gaborbernat
gaborbernat requested a review from ofek as a code owner October 15, 2026 23:52
@gaborbernat gaborbernat added the skip news No news fragment needed label Oct 15, 2026
@gaborbernat
gaborbernat merged commit a477a0a into tox-dev:main Oct 15, 2026
30 of 32 checks passed
@gaborbernat
gaborbernat deleted the fix/yamlfmt-workflows branch October 16, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news No news fragment needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant