When making a simple PR, being able to create it by just using the GitHub interface is great. However, most of our canonical data files have an additional character (newline I guess) at the end of the file. This has the effect of each PR created through the GitHub interface also automatically removing that trailing character. Wouldn't it be convenient if our canonical data files would all have that additional character stripped, such that it would become possible to create a GitHub PR without this automatic change?
I was interpreting this the other way around. The GitHub editor was adding a character (newline/cr, I am not clear on which) to the end of the file where one previously didn't exist.
Ah right, I might have misread the diff. Sorry about that! The principle still holds that I'd like the canonical data to be GitHub-friendly, which thus might mean _adding_ a newline instead of removing one.
each PR created through the GitHub interface also automatically removing that trailing character.
https://github.com/exercism/problem-specifications/pull/1444 is evidence in opposition to this statement
The GitHub editor was adding a character (newline/cr, I am not clear on which) to the end of the file where one previously didn't exist.
https://github.com/exercism/problem-specifications/pull/1444 is evidence in support of this statement
Travis CI should also be instructed (updated) to check for the proper (desired) ending of the canonical-data.json file.
after discussion in this issue has decided what (if any) reformatting is necessary, a logical next step would be to create an issue whose goal is to add any linting rules that arising from the reformatting, as suggested in https://github.com/exercism/problem-specifications/pull/1424#discussion_r245338736. The benefits would be that humans have to do less review work. If that is done, consider the effect on contributors (will they have to install the linter, etc., and/or is it easy for the contributors to apply a suggested change even if the linter is not installed).
README.md should be updated to instruct authors to include the necessary characters at the end of the file.
Not just the github interface, many other editors add a newline character to the end of the file.
There's a very good explanation for this on stackoverflow
The tl;dr version of it is that the POSIX standard defines a line as having a newline at the end. Thus, some programs have problems when the last line doesn't fit this standard.
Most helpful comment
Not just the github interface, many other editors add a newline character to the end of the file.
There's a very good explanation for this on stackoverflow
The tl;dr version of it is that the POSIX standard defines a line as having a newline at the end. Thus, some programs have problems when the last line doesn't fit this standard.