fix: allow PowerShell CRLF line endings

This commit is contained in:
2026-08-04 14:39:58 +02:00
parent be0e49fbc7
commit f4b9542c92
3 changed files with 68 additions and 0 deletions
@@ -74,3 +74,61 @@ Task implementation: `ad07a75` (`build: enforce portable line endings`)
None. The prescribed verifier and repository-integrity checks pass. A full Docker image build was
not run because this task's required validation is the shell verifier suite; the Dockerfile change
is structurally covered by the reviewed build instruction ordering.
## Fix round 1 — PowerShell CRLF policy
### Status
Complete. The verifier now applies the `.gitattributes` PowerShell exception: `*.ps1` files may
use CRLF, while CRLF remains a violation for the shell, YAML, and Dockerfile fixture inputs.
### Changed files
- `scripts/verify-line-endings.sh` — skips `.ps1` files before the CRLF rejection check.
- `scripts/test-verify-line-endings.sh` — adds a CRLF `valid.ps1` fixture and asserts it is not
reported; the fixture remains CRLF during the succeeding final verifier invocation.
### Red / green evidence
#### RED
Before the verifier change:
```text
$ bash scripts/test-verify-line-endings.sh
reported compliant CRLF PowerShell path: valid.ps1
```
The failure proves the new regression test exercised the existing incorrect behavior.
#### GREEN
After adding the `.ps1` exception:
```text
$ bash scripts/test-verify-line-endings.sh
line-ending verifier tests passed
```
The existing assertions still require `bad.sh`, `compose.yaml`, and `Dockerfile` to be reported,
while `valid.ps1` is rejected only if it is incorrectly reported. The final fixture verification
passes with `valid.ps1` still in CRLF form.
### Command and output summary
| Command | Result |
| --- | --- |
| `bash scripts/test-verify-line-endings.sh` (before change) | Exit 1: `reported compliant CRLF PowerShell path: valid.ps1`. |
| `bash scripts/test-verify-line-endings.sh` | Passed: `line-ending verifier tests passed`. |
| `bash scripts/verify-line-endings.sh` | Passed (exit 0; no output) for tracked repository files. |
| `git diff --check` | Passed (exit 0; no output). |
### Scope and self-review
The change is limited to the Important finding. It matches the existing lowercase `*.ps1`
pattern in `.gitattributes`, leaves the CRLF detection for every other file untouched, and does
not address either deferred Minor finding.
### Concerns
None.