Skip to content

fix: normalize CRLF to LF in test/test/box_string.cpp#1557

Merged
DefaultRyan merged 3 commits intomasterfrom
copilot/fix-line-endings-box-string
Apr 2, 2026
Merged

fix: normalize CRLF to LF in test/test/box_string.cpp#1557
DefaultRyan merged 3 commits intomasterfrom
copilot/fix-line-endings-box-string

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

test/test/box_string.cpp was committed with CRLF line endings (introduced in commit 3893ce8, PR #1530), violating the repo-wide .gitattributes policy (* text eol=lf).

Converts all line endings in test/test/box_string.cpp from \r\n to \n. No content changes in this file.

Also adds a workflow to check line endings in pull requests match the settings in .gitattributes.

Original prompt

The file test/test/box_string.cpp was committed with CRLF (\r\n) line endings in commit 3893ce8 (PR #1530). This conflicts with the repository's .gitattributes settings which require LF line endings for all text files:

* text=auto
* text eol=lf

The fix is to convert all line endings in test/test/box_string.cpp from CRLF to LF so that the file is consistent with the repository's .gitattributes policy.

No content changes are needed — only the line endings need to be normalized from \r\n to \n.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: This file appears to have been checked in with line endings that conflict with the settings in .gitattributes. Can you confirm and fix this?

Assistant:

I'll start by examining the file and the .gitattributes settings to confirm the conflict.

Assistant: Now let me check the actual line endings of the file by looking at the raw blob data:

Assistant: Let me check the blob via the API to inspect the raw content and line endings.

Assistant: Let me check the commit that introduced this file to see more details:

Assistant: Let me check the diff of the commit that introduced this file to see the line endings:

Assistant: Confirmed: The file test/test/box_string.cpp was checked in with CRLF (\r\n) line endings, which conflicts with the .gitattributes settings.

The conflict

The .gitattributes file specifies:

* text=auto
* text eol=lf

This means all text files should use LF line endings in the repository. However, the commit patch for box_string.cpp clearly shows \r (carriage return) characters at the end of every line, confirming it was committed with CRLF line endings.

This was introduced in commit 3893ce8 (PR #1530) by @justanotheranonymoususer — the file was newly added with CRLF endings, likely because the contributor's Git client didn't properly normalize the line endings before committing.

Fix

I can create a PR to convert the file to LF line endings. Would you like me to go ahead and do that?

User: Yes.

Assistant: I've kicked off the Copilot coding agent to create a PR that converts the line endings in test/test/box_string.cpp from CRLF to LF. You'll receive a notification once the pull request is ready for review.

This pull request was created from Copilot chat.

Agent-Logs-Url: https://github.com/microsoft/cppwinrt/sessions/9b31d4ec-f1c5-4859-89a1-3249eb553c5c

Co-authored-by: DefaultRyan <26174284+DefaultRyan@users.noreply.github.com>
Copilot AI changed the title [WIP] Normalize line endings for test/test/box_string.cpp fix: normalize CRLF to LF in test/test/box_string.cpp Apr 2, 2026
Copilot AI requested a review from DefaultRyan April 2, 2026 05:32
@DefaultRyan DefaultRyan marked this pull request as ready for review April 2, 2026 05:34
Copilot stopped work on behalf of DefaultRyan due to an error April 2, 2026 19:32
Copilot AI requested a review from DefaultRyan April 2, 2026 20:23
@DefaultRyan DefaultRyan merged commit d254f72 into master Apr 2, 2026
84 checks passed
@DefaultRyan DefaultRyan deleted the copilot/fix-line-endings-box-string branch April 2, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants