Skip to content

fix: enforce LF line endings for shell scripts on all platforms#1039

Open
Sdaswani wants to merge 1 commit into
thunderbird:mainfrom
Sdaswani:fix/cross-platform-line-endings
Open

fix: enforce LF line endings for shell scripts on all platforms#1039
Sdaswani wants to merge 1 commit into
thunderbird:mainfrom
Sdaswani:fix/cross-platform-line-endings

Conversation

@Sdaswani

@Sdaswani Sdaswani commented Jun 30, 2026

Copy link
Copy Markdown

Summary

  • Add .gitattributes to force LF line endings for *.sh and Makefile on checkout across Windows, macOS, and Linux
  • Add root .editorconfig so editors consistently use LF for cross-platform files

Problem

On Windows/WSL, shell scripts checked out with CRLF line endings cause bash errors when running dev tooling:

scripts/thunderdoctor.sh: line 2: $'\r': command not found
set: pipefail: invalid option name

This blocks make doctor and other Makefile targets that invoke bash scripts.

Solution

Git already stores these files with LF in the index; the missing piece is checkout normalization via .gitattributes (eol=lf) plus editor guidance via .editorconfig.

Test plan

  • Fresh clone into WSL home filesystem (~/thunderbolt-lf-test) — scripts/*.sh and Makefile have LF line endings (no CRLF)
  • make doctor runs without CRLF/bash parse errors (fails later only on missing tools, as expected)
  • Maintainer verifies on macOS/Linux clone

Notes

Developers with existing Windows checkouts on /mnt/c/ may need a one-time refresh after pulling:

git checkout -- scripts/ Makefile

Note

Low Risk
Repo-wide editor and Git checkout settings only; no runtime or application logic changes.

Overview
Adds .gitattributes so *.sh and Makefile always check out with LF, fixing CRLF-related bash failures on Windows/WSL when running targets like make doctor. Windows script types (*.bat, *.cmd, *.ps1) stay CRLF; common binary extensions are marked binary.

Adds a root .editorconfig with LF defaults, tab indents for Makefile, CRLF for Windows scripts, and 2-space indent for JSON/YAML/lock files.

Reviewed by Cursor Bugbot for commit 30ea86f. Bugbot is set up for automated code reviews on this repo. Configure here.

Add .gitattributes and .editorconfig so shell scripts and Makefile always checkout with Unix line endings. Fixes bash/WSL CRLF errors when running make doctor on Windows.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Sdaswani Sdaswani deployed to fork-preview-approval June 30, 2026 04:08 — with GitHub Actions Active
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