pre-commit / pre-commit-hooks

Some out-of-the-box hooks for pre-commit
MIT License
5.4k stars 710 forks source link

end-of-file-fixer doesn't work correctly with CRLF endings #1078

Closed edobez closed 4 months ago

edobez commented 4 months ago

end-of-file-fixer adds a LF before the last empty line, regardless of what are the EOL of the file. On Windows, where typical EOL are CRFL, leaves the files with mixed endings.

edobez commented 4 months ago

I added the following test line in end_of_file_fixer_test.py to reproduce the problem: (b'foo\r\nbar', 1, b'foo\r\nbar\r\n').

asottile commented 4 months ago

please search the issue tracker