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

Build potentially creates mixed newlines #420

Open
hynek opened this issue Sep 3, 2022 · 1 comment
Open

Build potentially creates mixed newlines #420

hynek opened this issue Sep 3, 2022 · 1 comment

Comments

@hynek
Copy link
Member

hynek commented Sep 3, 2022

As part of working on #419 I've noticed that the old change log is read using universal new lines, the fragments don't touch them, and finally the new file is written without touching.

This means that if a fragment has windows new lines, only the said fragment is rendered with them and the rest is not.

We should load the fragments with universal new lines too to be consistent.

That means that the change log has different new lines depending on the OS, but that might be a feature?

Another option is to make it an Option.

@adiroiban
Copy link
Member

Thanks for the followup.

I think we should try to keep the configuration option to a minimum, as a general goal.
Add option only if really needed.

I guess that towncrier can look at the newlines from current file.

if it finds any \r\n pairs, it will enter Windows mode -
Any content is kept as it is, and new content is generated with \r\n

If it can't find \r\n it can assume Unix mode, and existing content is kept as it is, and new content generated with just \n.

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

No branches or pull requests

2 participants