Windows checkouts can convert tracked shell scripts to CRLF when Git uses core.autocrlf=true. ShellCheck then reports SC1017 on affected lines, creating widespread editor diagnostics even though the indexed scripts use LF.
Component
Development Environment
Steps to Reproduce
- Configure Git with
core.autocrlf=true on Windows.
- Check out the repository without a shell-specific line-ending policy.
- Open a tracked
.sh file in VS Code with ShellCheck diagnostics enabled.
- Observe SC1017 literal carriage-return errors.
Expected Behavior
Tracked .sh files use LF in the worktree regardless of the contributor's global Git line-ending configuration.
Environment
- OS: Windows
- Git setting:
core.autocrlf=true
- Editor: Visual Studio Code
Error Output
Literal carriage return. Run script through tr -d '\r' .
Acceptance Criteria
Windows checkouts can convert tracked shell scripts to CRLF when Git uses
core.autocrlf=true. ShellCheck then reports SC1017 on affected lines, creating widespread editor diagnostics even though the indexed scripts use LF.Component
Development Environment
Steps to Reproduce
core.autocrlf=trueon Windows..shfile in VS Code with ShellCheck diagnostics enabled.Expected Behavior
Tracked
.shfiles use LF in the worktree regardless of the contributor's global Git line-ending configuration.Environment
core.autocrlf=trueError Output
Acceptance Criteria
.gitattributesfile declares*.sh text eol=lf..gitattributesis not excluded by.gitignore..shfile resolves totext: setandeol: lf.