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

Line ending options #130

Closed
wants to merge 7 commits into from
Closed

Conversation

takluyver
Copy link
Contributor

Closes #121, alternative to #129.

This is slightly less efficient than the approach in #129, because the file is re-read and re-written, but it doesn't involve monkeypatching anything, so it's more robust. Given that the parsing and refactoring machinery is already an order of magnitude slower than reading/writing files, I think the more robust approach is preferable.

This uses a subclass of StdoutRefactoringTool. If the line endings were specified, after a file is written by 2to3, we immediately read it again and rewrite it with the specified newlines.

@techtonik
Copy link
Contributor

@takluyver #131 contains a proof of concept how to do this without extra options.

@graingert
Copy link
Member

@takluyver I think this should be done on fissix, also closing in favour of #131

@graingert graingert closed this Sep 3, 2020
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.

Preserve line separator format (Unix vs. Windows)
4 participants