New hooks: find-data-files to ensure that data files are not added

make-sure-hooks-synced to ensure that hooks are committed consistently
to checker.

Updates to README.md to document standard directories

Adding Resources as standard files for all repos to consume.
This commit is contained in:
2025-10-09 09:59:46 -05:00
parent 5bcfefb279
commit 3538b44a20
6 changed files with 62 additions and 0 deletions

10
Hooks/scripts.d/find-data-files Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
# We don't want to commit data files, with the exceptions being our GPG public key and organization logo in PNG & ASCII format.
result="$(git ls-files | xargs -n 1 file | grep -Ev ASCII\ text\|JSON\|empty\|Unicode\ text | grep -vE '^Resources/logo.png|^Resources/ascii.txt|^Resources/public.gpg')"
if [ -n "$result" ]; then
echo "These files need to be evaluated -- generally, don't commit data files to Git."
echo "$result"
exit 1
fi
exit 0

View File

@@ -0,0 +1,4 @@
if [ `git ls-files -m | grep -E '^Hooks/scripts.d|^precommit-hooks/' | wc -l` != '0' ]; then
echo 'Hooks have changed and need to be added. Run `git add precommit-hooks`'
exit 1
fi