Code to preserve original linefeeds (issue #121)
This is pseudo code - it may work or may not. I haven't got chance to test it yet
Nice, I like this idea
Well, Python 3 is a pain. But it should work for now on Python 2. I may be able to finish this later.
I am not sure I can work on a test. Not today. Basically, the test need to create two files - one with LF linefeeds and another with CRLF. And after fix is applied, check that linefeeds didn't change. So either produce 4 files (input and output) or copy/paste the function being tested to the test case (which is no good). The files are also can not be committed to Git, because it messes with linefeeds.
I added machinery for testing line endings in #130 (actually, it's a modification of @daira's machinery in #129). We can reuse that for this, although the actual tests will need to be slightly different.
This isn't correct as-is, but I like the basic approach. I will work on it tomorrow.
@techtonik I think this feature would be best in https://github.com/jreese/fissix
@graingert I see this project became derived from fissix, which need more docs to understand what is latest lib2to3 and what are enhancements.
@techtonik not much has changed, but you can see what enhancements are applied here: https://github.com/jreese/fissix/blob/main/scripts/update.sh
Everything goes via black + a git merge from CPython master
@jreese maybe a changelog will help?