From bd3b094798cd72ff23997ff2fcbfa55510b3c7e7 Mon Sep 17 00:00:00 2001 From: Chris Wolfgang Date: Sat, 9 May 2026 20:20:02 -0400 Subject: [PATCH] chore: sync *.ps1 EOL fix from canonical (repo-template #347 + #348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removes the CRLF + UTF-8-BOM overrides for *.ps1 files in .gitattributes and .editorconfig. Required for the '#!/usr/bin/env pwsh' shebang at the top of every script in scripts/ to work as an executable on Linux/macOS. No file content rewrites — index has been LF the whole time. Only attr declarations align with reality now. Co-Authored-By: Claude Opus 4.7 (1M context) --- .editorconfig | 9 +++++---- .gitattributes | 13 ++++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.editorconfig b/.editorconfig index c055adec..df34937a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,12 +26,13 @@ indent_size = 2 indent_size = 2 # PowerShell files -# PowerShell uses CRLF to maintain compatibility with Windows and PowerShell conventions -# This overrides the global end_of_line = lf setting and aligns with .gitattributes line 14 +# Only the indent override is needed; LF + UTF-8 (no BOM) come from the +# global [*] section above. LF + no-BOM is required for the +# `#!/usr/bin/env pwsh` shebang at the top of every script in scripts/ +# to work on Linux/macOS — CR breaks the kernel's exec lookup, and a +# leading BOM prevents shebang recognition entirely. [*.ps1] indent_size = 4 -end_of_line = crlf -charset = utf-8-bom # C# files [*.cs] diff --git a/.gitattributes b/.gitattributes index 85e69692..2dd9f222 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,11 +9,14 @@ *.fsx text eol=lf # Scripts -# PowerShell scripts: CRLF line endings (intentional override) -# Both .gitattributes and .editorconfig consistently configure PowerShell files -# to use CRLF (Windows-style) line endings for PowerShell convention compliance. -# See .editorconfig [*.ps1] section for the matching configuration. -*.ps1 text eol=crlf +# PowerShell scripts: LF line endings, no BOM. Required for the +# `#!/usr/bin/env pwsh` shebang to work on Linux/macOS — the kernel +# parses CR as part of the interpreter name (looking for `pwsh\r`), +# and a UTF-8 BOM before `#!` prevents shebang recognition entirely. +# Modern PowerShell 7+ handles LF on Windows transparently; Git's +# autocrlf still gives Windows users CRLF in their working tree if +# desired without forcing CRLF into the index. +*.ps1 text eol=lf # Build and configuration files