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

Make line separator configurable #135

Open
djspiewak opened this issue Oct 4, 2017 · 1 comment
Open

Make line separator configurable #135

djspiewak opened this issue Oct 4, 2017 · 1 comment

Comments

@djspiewak
Copy link

Yes, this is a Windows issue. :-(

It's relatively common on projects to standardize on Unix line endings even when doing development on Windows, mostly for the sanity of all involved. sbt-header mostly handles this in a reasonable way in every respect except for the fact that it appears to constantly try to recreate headers. The detection hard-codes System.lineSeparator() as the expected line terminator, and so what happens if you have a bunch of files with valid license headers but the "wrong" line ending is sbt-header will detect them all as needing new headers, then write a new header for each file using the overridden line endings (since we control the license contents), ultimately leaving the file unchanged. The practical effect of this is that sbt-header touches every file on every compile, leaving their contents unchanged but still re-written to disk.

This in turn requires workarounds like this to make sbt-header meaningfully usable across platforms.

If we had the ability to configure newLine, this really wouldn't be an issue. Or if there was at least a sanity check to ensure that newLine matched the line endings used in the configured license (usually \n).

@hseeberger
Copy link
Member

PR welcome, Daniel ;-)

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