fix(.editorconfig/.gitattributes/scripts): doc accuracy + missing shebang + missing eol=lf#350
Closed
Chris-Wolfgang wants to merge 2 commits into
Closed
fix(.editorconfig/.gitattributes/scripts): doc accuracy + missing shebang + missing eol=lf#350Chris-Wolfgang wants to merge 2 commits into
Chris-Wolfgang wants to merge 2 commits into
Conversation
Two follow-ups to the hardening landed in #345 (review comments on ETL-FixedWidth#88): - Wrap the deploy step body in try { ... } finally { ... } so the http.extraheader unset always runs. Previously, any early `exit 1` path (failed ls-remote, missing version-picker template) would leave the encoded token in the runner's global git config for the remaining steps in the job. - Replace `$global:LASTEXITCODE = $deployExitCode` with explicit `if ($deployExitCode -ne 0) { exit $deployExitCode }` after the finally. PowerShell does not reliably surface a script block's $LASTEXITCODE as the step exit code (especially when the final statement is an assignment), so a failed `git commit` / `git push` was being reported as step success. Default $useWorktree to $false before the try block so the cleanup path picks the safe Remove-Item branch if the try fails before the ls-remote check assigns it.
…bang + missing eol=lf Three small canonical fixes flagged by Copilot review on a downstream sync (Try-Pattern PR #109): - .editorconfig: drop the redundant [*.ps1] indent_size = 4 block (the global [*] section already sets indent_size = 4) and reword the comment so it doesn't claim an override is 'needed'. - .gitattributes: clarify in the *.ps1 comment that only EOL is enforced here. BOM-free encoding is handled by .editorconfig's global charset = utf-8 setting, not by .gitattributes (which has no ability to control byte-order marks). Also add the missing eol=lf attribute — previously the rule was just '*.ps1 text', so the LF claim in the comment wasn't actually being enforced; users with autocrlf=true would still get CRLF in the index. - scripts/Setup-Labels.ps1: add the missing #!/usr/bin/env pwsh shebang. The other 4 scripts in scripts/ all have it, and the comments in .editorconfig + .gitattributes both reference 'every script in scripts/' having a shebang — bringing reality in line with the documentation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
Author
|
Closing — branch is stale. Three other PRs landed in parallel (#347 + #348 covering most of the .editorconfig/.gitattributes work, plus an unnumbered direct-commit |
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
Three small canonical fixes flagged by Copilot review on a downstream sync (Try-Pattern PR #109).
Changes
.editorconfigThe PowerShell section had:
The global
[*]section already setsindent_size = 4, so the override was redundant. The accompanying comment claimed an override was "needed" — wasn't true. Dropped the section entirely; reworded the comment to say PowerShell inherits everything from[*]..gitattributesTwo issues with the
*.ps1rule:The comment claimed "LF line endings, no BOM" — but
.gitattributescan only enforce EOL, not byte-order marks. BOM is an encoding concern handled by.editorconfig's globalcharset = utf-8. Reworded to clarify.The actual rule was just
*.ps1 text— noeol=lf. So despite the LF comment, the LF wasn't actually being enforced; users withautocrlf=truewould still get CRLF in the index. Addedeol=lf.scripts/Setup-Labels.ps1Was missing the
#!/usr/bin/env pwshshebang. The other 4 scripts inscripts/all have it, and both.editorconfigand.gitattributescomments reference "every script in scripts/" having a shebang — bringing reality in line with documentation.Note about the protected-files guard
This PR touches
.editorconfigso theDetect .NET Projectsguard will fail it. Maintainer override required.Cascade
After this lands, downstream sync PRs (like Try-Pattern #109, which already mirrors these fixes manually) won't keep re-introducing the inaccurate comments / missing shebang.
Test plan
chore: sync from canonicaldoesn't reintroduce the issues