modernize icon indicating copy to clipboard operation
modernize copied to clipboard

Code to preserve original linefeeds (issue #121)

Open techtonik opened this issue 10 years ago • 8 comments

This is pseudo code - it may work or may not. I haven't got chance to test it yet

techtonik avatar Oct 19 '15 10:10 techtonik

Nice, I like this idea

takluyver avatar Oct 19 '15 10:10 takluyver

Well, Python 3 is a pain. But it should work for now on Python 2. I may be able to finish this later.

techtonik avatar Oct 19 '15 10:10 techtonik

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.

techtonik avatar Oct 19 '15 11:10 techtonik

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.

takluyver avatar Oct 19 '15 12:10 takluyver

This isn't correct as-is, but I like the basic approach. I will work on it tomorrow.

daira avatar Oct 20 '15 12:10 daira

@techtonik I think this feature would be best in https://github.com/jreese/fissix

graingert avatar Aug 23 '20 22:08 graingert

@graingert I see this project became derived from fissix, which need more docs to understand what is latest lib2to3 and what are enhancements.

techtonik avatar Sep 05 '20 09:09 techtonik

@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?

graingert avatar Sep 05 '20 09:09 graingert