fix: enforce LF line endings for shell scripts on all platforms#1039
Open
Sdaswani wants to merge 1 commit into
Open
fix: enforce LF line endings for shell scripts on all platforms#1039Sdaswani wants to merge 1 commit into
Sdaswani wants to merge 1 commit into
Conversation
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>
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 force LF line endings for*.shandMakefileon checkout across Windows, macOS, and Linux.editorconfigso editors consistently use LF for cross-platform filesProblem
On Windows/WSL, shell scripts checked out with CRLF line endings cause bash errors when running dev tooling:
This blocks
make doctorand 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
~/thunderbolt-lf-test) —scripts/*.shandMakefilehave LF line endings (no CRLF)make doctorruns without CRLF/bash parse errors (fails later only on missing tools, as expected)Notes
Developers with existing Windows checkouts on
/mnt/c/may need a one-time refresh after pulling:Note
Low Risk
Repo-wide editor and Git checkout settings only; no runtime or application logic changes.
Overview
Adds
.gitattributesso*.shandMakefilealways check out with LF, fixing CRLF-related bash failures on Windows/WSL when running targets likemake doctor. Windows script types (*.bat,*.cmd,*.ps1) stay CRLF; common binary extensions are marked binary.Adds a root
.editorconfigwith LF defaults, tab indents forMakefile, 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.