diff --git a/STYLE.md b/STYLE.md index a2e5feca4..509e7d880 100644 --- a/STYLE.md +++ b/STYLE.md @@ -132,6 +132,13 @@ sed -i 's/\t/ /g;s/[[:space:]]*$//g' Note: For macOS and BSD related distros, you may need to use `sed -i ''` inplace due to differences with GNU sed. +``` bash +git ls-files -z | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done +``` + +Use this to auto append a newline to the end of the file for any files that are under git. +Taken from [here](https://unix.stackexchange.com/a/161853) + ### For Powershell/pwsh ``` Powershell