8000 Autocorrected CRLF to LF by SteveL-MSFT · Pull Request #4943 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Autocorrected CRLF to LF #4943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 29, 2017
Merged

Autocorrected CRLF to LF #4943

merged 3 commits into from
Sep 29, 2017

Conversation

SteveL-MSFT
Copy link
Member
@SteveL-MSFT SteveL-MSFT commented Sep 29, 2017

Fixed Parser.Tests.ps1 to use regex:

$result | should match "\r?\nfoo``u\{2195\}abc\r?\n"

@daxian-dbw
Copy link
Member

Add ?w=1 to the URL to see the diff with whitespace ignored --
https://github.com/PowerShell/PowerShell/pull/4943/files?w=1. It looks good to me.

@SteveL-MSFT
Copy link
Member Author

@daxian-dbw that's an awesome tip!


'@
"@
$result | should match "\r?\nfoo``u\{2195\}abc\r?\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, one question about \r?\n here. Is it because we use CRLF on windows and LF on Unix? If so, can we do the following instead?

$newLine = [System.Environment]::NewLine
$result | should be "${newLine}foo``u\{2195\}abc${newLine}"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is because git converts files to CRLF on Windows. I like your suggestion and will make the change.

@SteveL-MSFT
Copy link
Member Author

@daxian-dbw I'm going to revert that last change, seems that on Windows you might have git set to not convert to CRLF which may be why it's failing on AppVeyor as it was just LF.

address PR feedback
This reverts commit 5a35a4a342581545cc3d22ec608c03d50ccebc85.
@daxian-dbw daxian-dbw merged commit 2639cd8 into PowerShell:master Sep 29, 2017
@SteveL-MSFT SteveL-MSFT deleted the crlf2lf branch October 26, 2018 21:34
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
0