Remove extraneous CR characters from normalized code snippets.#2927
Merged
Conversation
- Replace any /r/r with /r - Add comment calling the issue out for me to follow up with later. - Correct fix is for the normalization python script to be corrected.
- Normalization script uses LF for splitting lines - Python replaces LF with CRLF when writing to stdout. - codeExecution helper tests were not unit tests - they shell out to Python, unit tests don't do this. - Remove hack-fix to correct output from normalization script.
DonJayamanne
approved these changes
Oct 17, 2018
DonJayamanne
pushed a commit
that referenced
this pull request
Oct 18, 2018
Remove extraneous CR characters from normalized code snippets. - Correct normalization python script to use LF instead of CRLF to split lines. - On windows, Python will inject CR whenever it sees an LF written to stdout. - This was the root cause of the CRCRLF coming back from normalization. - Change helper.unit.test to helper.test, it shells out to Python and is not a unit test suite. - Re-enable tests for helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix the
normalizeForInterpreter.pyscript.The script would split lines using
os.linesepwhich on Windows isCRLF. On Windows, when Python detects anyLFbeing written to stdout, it replaces it withCRLF. Therefore, our script was unintentionally causingCRCRLFto be written to stdout.For #2857
added/updatedpackage-lock.jsonhas been regenerated by runningnpm install(if dependencies have changed)