Starting to use Uniglot for hooks standardization.

This commit is contained in:
2022-04-30 23:14:56 -05:00
parent ce2e2d3863
commit f034d627a6
17 changed files with 234 additions and 11 deletions

23
Hooks/scripts.d/whitespace Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Sourced from https://github.com/git/git/blob/master/templates/hooks--pre-commit.sample
if egrep -irl '\s\+$' .; then
echo The above lines have trailing whitespace. Run "sed -i 's/\s\+$//'" on the affected files.
exit 1
fi
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi
# Redirect output to stderr.
exec 1>&2
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --