mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-10-08 08:10:35 -04:00
Add a terminating LF to tracked text files that were missing a
newline at end of file. This avoids Codacy whitespace failures and
ensures text files conform to the repository line-ending policy.
Affected files were identified and fixed with the following script.
It checks all tracked files against .gitattributes, skips files marked
as binary or -text, and reports the final 32 bytes of any non-empty text
file that does not end with LF before adding the missing newline.
git ls-files -z |
while IFS= read -r -d '' f; do
attr=$(git check-attr text -- "$f")
case "$attr" in
"$f: text: unset"|"$f: text: unspecified")
continue
;;
esac
[ -f "$f" ] || continue
[ -s "$f" ] || continue
[ "$(tail -c 1 -- "$f" | od -An -t x1 | tr -d ' \n')" = "0a" ] || {
printf '%s\n' "$f"
tail -c 32 -- "$f" | hexdump -C
printf '\n' >> "$f"
}
done
Signed-off-by: Robin Getz <rgetz503@gmail.com>