pharo-vcs / tonel

MIT License
32 stars 26 forks source link

TonelWriter uses the platform line ending #99

Closed gcotelli closed 2 years ago

gcotelli commented 2 years ago

TonelWriter uses the platform line ending convention when writing new lines. This is problematic for projects with contributors using different OS versions. I have been bitted more than once with Pull Requests made from people using Windows because every little file looks like changed due to line endings. I think it's better to settle into ONE line-ending convention for all the platforms. Any decent editor can read any of the line-ending formats so I don't see a problem here, and it will make project maintainers happier :smile: . I propose to use the UNIX line-ending format given that is the native one in 2 of the 3 supported platforms.

jecisc commented 2 years ago

I've been bitten by that too

martinmcclure commented 2 years ago

The decision to use platform-specific line endings was deliberate. If code is managed in Git, Git can (and should be configured to) adjust the line endings in the repository, so no changes are recorded in Git.

From the draft Tonel spec (comments welcome) https://github.com/GemTalk/TonelSpec/blob/master/TonelSpec1.0-draft1.txt

Line ending conventions
In all Tonel files, line ends must use the convention of the local operating system environment. This means CRLF for Windows, LF for Unix/Mac. It is recommended that users of Tonel configure their Git repositories to use LF line endings internally, and let Git handle the translation on the way in and out.
estebanlm commented 2 years ago

indeed, as Martin says. You can always configure git to avoid this problems. See https://github.com/pharo-project/pharo/blob/Pharo10/.gitattributes as an example.