Skip to content
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

Remove extraneous CR characters from normalized code snippets. #2927

Merged
merged 3 commits into from
Oct 17, 2018

Conversation

d3r3kk
Copy link

@d3r3kk d3r3kk commented Oct 17, 2018

Fix the normalizeForInterpreter.py script.

The script would split lines using os.linesep which on Windows is CRLF. On Windows, when Python detects any LF being written to stdout, it replaces it with CRLF. Therefore, our script was unintentionally causing CRCRLF to be written to stdout.

For #2857

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Unit tests & system/integration tests are added/updated
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)

- 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.
@d3r3kk d3r3kk merged commit d7a8f3a into microsoft:master Oct 17, 2018
@d3r3kk d3r3kk deleted the 2857_win_run_selection branch October 17, 2018 21:46
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.
@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants