You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check if all files in the repository end in a newline (https://stackoverflow.com/a/25686825)
51
-
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'if test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0"; false; fi'
46
+
# Formatting checks:
47
+
# Check for files starting with a blank line
48
+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
57
+
# Check for files that don't end in a newline (https://stackoverflow.com/a/25686825)
58
+
- find . -path ./.git -prune -o -type f -print0 | xargs -0 -L1 bash -c 'if test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
0 commit comments