nedbat / scriv

Changelog management tool
https://scriv.readthedocs.io
Apache License 2.0
260 stars 29 forks source link

Respect the current CHANGELOG newlines #14

Closed kurtmckee closed 3 years ago

kurtmckee commented 3 years ago

Ned, thanks so much for creating scriv! I'm working to implement it for the feedparser project and I'm very pleased with it in my preliminary testing!

I have found a potential improvement opportunity: it appears that scriv is assuming my files use Windows newlines (CRLF), but I've configured git to checkout as-is. Consequently, all of my development is done using LF-only newlines regardless of platform.

However, scriv collect is rewriting my changelog newlines using CRLF. It looks like this is happening in collect.py, where scriv uses pathlib.Path.read_text() and pathlib.Path.write_text(). Both of these functions end up calling open() with newline=None, which is where there's an opportunity to improve this situation.

I'm going to work to fix this and submit a PR. Please let me know if you've got a strong opinion about how to proceed, or if this type of change isn't welcome. Otherwise I'll submit a PR and wait for your review.

Thanks again for creating this tool!

nedbat commented 3 years ago

This is now available in scriv 0.10.0

kurtmckee commented 3 years ago

Ned, this is great news. Thank you so much for releasing this fix! Happy holidays!