fix(platform): add .gitattributes for Windows CRLF line ending issues#93
Merged
fix(platform): add .gitattributes for Windows CRLF line ending issues#93
Conversation
…ows CRLF On Windows, git checkout converts LF to CRLF by default. This breaks bash scripts with: ': invalid option namesh: line 2: set: pipefail' Three-layer fix: - .gitattributes in both root and template to enforce LF for shell scripts, Dockerfiles, and YAML files - Post-gen hook normalizes CRLF->LF as belt-and-suspenders for cookiecutter's text-mode rendering on Windows - Windows CI smoke test now explicitly verifies LF line endings Also removes dead get_os.sh (unreferenced by any file in the project). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Nice work! 😎
I didn't find anything of concern
Did you know Zenable also supports GitLab SaaS and self-managed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.gitattributesto both root repo and template to enforce LF line endings for shell scripts, Dockerfiles, and YAML files — prevents Windowsgit checkoutfrom converting to CRLF which breaks bash with': invalid option namesh: line 2: set: pipefail'normalize_line_endings()in post-gen hook as belt-and-suspenders for cookiecutter's text-mode rendering on Windowsget_os.shscript (unreferenced by any file in the project)Test plan
test_gitattributes_exists— verifies.gitattributesin generated projectstest_shell_scripts_have_lf_line_endings— verifies no CRLF in.shfilestest_dockerfile_has_lf_line_endings— verifies no CRLF in Dockerfiletest_no_dead_shell_scripts— verifies all scripts are referenced (caughtget_os.sh)🤖 Generated with Claude Code