Skip to content

Replace hardcode linefeed - #11746

Merged
Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
TylerLeonhardt:replace-hardcode-linefeed
Feb 3, 2020
Merged

Dongbo Wang (daxian-dbw) merged 3 commits into
PowerShell:masterfrom
TylerLeonhardt:replace-hardcode-linefeed

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Jan 31, 2020 •

Copy link
Copy Markdown
Member

PR Summary

I've moved it over to using Environment.NewLine. I added a test to test this specific thing... but maybe in the future we can put that test in a "crossplat" test file that checks all of our ToString's to make sure they honor the newline for the platform.

PR Context

There was a hardcoded line feed in the ToString method of ParseError. this caused a CI test failure in the Jupyter kernel because on Windows, there would be all \r\n except for this single instance of \n.

Tooling could be impacted, but from my look around the tooling code, I don't think it would be.

This is a breaking change, albeit small... and worth it IMO.

PR Checklist

@TylerLeonhardt

Copy link
Copy Markdown
Member Author

PoshChan-Bot (@PoshChan) please retry macos

@PoshChan

Copy link
Copy Markdown
Collaborator

TylerLeonhardt, successfully started retry of PowerShell-CI-macOS

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Rob Holt (@rjmholt) Any possibility this simple change could cause a regression?

At line:1 char:5
+ $x =
+ ~
You must provide a value expression following the '=' operator.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Localized message is not good in test. We could remove it and check that right newline is after the extend.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've reworked the test.

@rjmholt

Rob Holt (rjmholt) commented Jan 31, 2020 •

Copy link
Copy Markdown
Collaborator

Any possibility this simple change could cause a regression?

I don't know of anything that depends on the ToString() behaviour of this class. Certainly nothing should.

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit ac1b83f into PowerShell:master Feb 3, 2020
@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Feb 4, 2020
@iSazonov Ilya (iSazonov) added this to the 7.1.0-preview.1 milestone Feb 4, 2020
@daxian-dbw

Copy link
Copy Markdown
Member

Any possibility this simple change could cause a regression?

I don't know of anything that depends on the ToString() behaviour of this class. Certainly nothing should.

Guess what, our error view depends on this ToString() behavior 😄 This PR accidentally fixed a regression in the concise view for parsing errors.

@rjmholt

Copy link
Copy Markdown
Collaborator

our error view depends on this ToString() behavior

🤦‍♂

@ghost

Copy link
Copy Markdown

🎉v7.1.0-preview.1 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants