I made a mistake in my .editorconfig definition and forgot to add
insert_final_newline = true
So now some files do have a newline at the end while some do not.
I found similar questions such as:
- How can I add a trailing newline to files that don't have it?
- https://serverfault.com/questions/339827/sed-add-new-line-to-every-file-that-does-not-have-one-at-end-of-file
However the solutions provided there add a newline to all files. I need to only add it to those that don't have a final newline already.
EDIT: The question that was linked as answering mine question doesn't do so as the answers are for single file only. I need this recursively for all files. Voting to reopen.