See https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
A newline in a text file is a terminator, not a separator. This means each line should have a newline at the end of it, including the last line of the file.
Many editors automatically add the newline at the end of the file. Some do not. If you can configure your editor to ensure there is always a newline at the end of every line, please do so.
Because many editors do add this newline, if you commit a text file without it, when someone else edits the file, their editor will (correctly) add the newline. This causes a spurious diff in the file. Spurious