fix: add .gitattributes to enforce LF line endings for Windows CI#67
Conversation
❌ Deploy Preview for to-unocss failed. Why did it fail? →
|
On Windows, git checks out text files with CRLF line endings by default. This caused test failures because: - Snapshot files had CRLF but transform output had LF - Transform functions produced different output due to \r in input - CRLF-sensitive regex patterns failed to match properly Adding `* text=auto eol=lf` ensures all text files use LF line endings on all platforms, matching the behavior on Linux and macOS. Co-authored-by: Simon-He95 <57086651+Simon-He95@users.noreply.github.com> Agent-Logs-Url: https://github.com/Simon-He95/transformToUnoCSS/sessions/c29a2371-a2b9-4fc0-bd70-45db2ad8d953
Deploying transformtounocss with
|
| Latest commit: |
d9a9def
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://33d4874c.transformtounocss.pages.dev |
| Branch Preview URL: | https://copilot-fix-ci-test-windows.transformtounocss.pages.dev |
|
@copilot 修复有问题,继续修复,下面是失败的原因,我猜测可能是windows上一些文件路径的问题 Run nr test
RUN v3.2.4 D:/a/transformToUnoCSS/transformToUnoCSS ✓ test/sass-mixed-decls.test.ts (5 tests) 519ms stdout | test/complex-scss-for-loop.test.ts > Complex SCSS for-loop and variable syntax > should handle SCSS @for loops with variables correctly stdout | test/complex-scss-for-loop.test.ts > Complex SCSS for-loop and variable syntax > should handle SCSS @for loops with variables correctly stdout | test/complex-scss-for-loop.test.ts > Complex SCSS for-loop and variable syntax > should handle SCSS @for loops with variables correctly stdout | test/complex-scss-for-loop.test.ts > Complex SCSS for-loop and variable syntax > should handle SCSS @for loops with variables correctly
❯ test/transformAstro.test.ts:57:20 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ Test Files 1 failed | 14 passed (15) Error: AssertionError: expected '---\nexport const prerender = true;\n…' to contain 'text-red'
❯ test/transformAstro.test.ts:57:20 ELIFECYCLE Test failed. See above for more details. |
Tests fail on
windows-latestdue to CRLF line endings. Git checks out text files with\r\non Windows, which breaks snapshot comparisons and CRLF-sensitive regex patterns in the transform functions..gitattributeswith* text=auto eol=lfto normalize line endings across all platformsNo source or test changes required — the line ending normalization at the git layer is sufficient.
Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.