Use standard line ending in examples #2
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, some of the example sketch files used "CR" ("carriage return") line endings.
This line ending was standard in the classic "Mac OS" operating system (note this is different from the modern macOS). Apple switched to a POSIX-compliant operating system and "LF" ("line feed") line endings in 2001 with the release of OS X 10.0. Linux has always used "LF" line endings. Although Windows has historically used "CRLF" as the native line ending, "LF" is well supported (far more so than "CR"). For this reason, "LF" line endings are the standard for Arduino projects and software projects in general.
The use of the obsolete and non-standard "CR" line endings might cause difficulty for users working with the sketches in applications that don't have full support for "CR" line endings (example). It also might cause difficulties for contributors to the sketch code and for the project maintainers reviewing those contributions. For example, the GitHub web interface does not recognize these line endings and so displays the entire sketch as a single long line of code:
https://github.com/arduino-libraries/CTC-Go-Motions-Expansion/blob/4d5d89aee1fdf9dee7592a27173c2e351576de29/examples/Projects/SpinAWheel/spinAWheel_Stage1/spinAWheel_Stage1.ino
And the diff view for these files is quite unpleasant:
85c1056#diff-e01fd5adba854647f0da888d7aa964859a29e502f2e75a31d02eb3e6e9b82ad7
This pull request replaces the obsolete and inconsistent "CR" line endings with standard "LF" line endings.
Originally reported by @ElEstes at 85c1056#commitcomment-134605642