Skip to content

fix(platform): add .gitattributes for Windows CRLF line ending issues#93

Merged
JonZeolla merged 1 commit intomainfrom
fix/crlf-line-endings
Apr 6, 2026
Merged

fix(platform): add .gitattributes for Windows CRLF line ending issues#93
JonZeolla merged 1 commit intomainfrom
fix/crlf-line-endings

Conversation

@JonZeolla
Copy link
Copy Markdown
Member

Summary

  • Add .gitattributes to both root repo and template to enforce LF line endings for shell scripts, Dockerfiles, and YAML files — prevents Windows git checkout from converting to CRLF which breaks bash with ': invalid option namesh: line 2: set: pipefail'
  • Add normalize_line_endings() in post-gen hook as belt-and-suspenders for cookiecutter's text-mode rendering on Windows
  • Add explicit LF line ending verification step to Windows CI smoke test (this is why the existing smoke test didn't catch the bug — it never checked line endings)
  • Remove dead get_os.sh script (unreferenced by any file in the project)

Test plan

  • TDD: 4 new unit tests written before implementation, all pass
    • test_gitattributes_exists — verifies .gitattributes in generated projects
    • test_shell_scripts_have_lf_line_endings — verifies no CRLF in .sh files
    • test_dockerfile_has_lf_line_endings — verifies no CRLF in Dockerfile
    • test_no_dead_shell_scripts — verifies all scripts are referenced (caught get_os.sh)
  • All 52 unit tests pass
  • Linting passes
  • Windows smoke test in CI verifies LF line endings explicitly

🤖 Generated with Claude Code

…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>
Copy link
Copy Markdown

@ai-coding-guardrails ai-coding-guardrails bot left a comment

Choose a reason for hiding this comment

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

Nice work! 😎

I didn't find anything of concern

Did you know Zenable also supports GitLab SaaS and self-managed?

@JonZeolla JonZeolla merged commit 4b3aaff into main Apr 6, 2026
5 checks passed
@JonZeolla JonZeolla deleted the fix/crlf-line-endings branch April 6, 2026 11:04
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