This commit is contained in:
2025-07-23 13:40:29 -04:00
parent f62cecbfd3
commit 9e94f5ce44
7 changed files with 255 additions and 202 deletions

44
tools/check_header Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/env bash
# Usage: ./check_header
if pwd | grep -q tools; then
cd ..
fi
files=$(find yait \( -name '*.c' -o -name '*.h' \))
files+=" "
files+=$(find core \( -name '*.c' -o -name '*.h' \))
files+=" $(find . -maxdepth 1 -type f)"
ignore="README COPYING .clang-format config.mak"
if [ -z "$files" ]; then
echo "No files found"
exit 0
fi
missing=""
for file in $files; do
if echo "$ignore" | grep -qw "$(basename "$file")"; then
continue
fi
echo -ne "$file... "
if grep -q "Copyright (C)" "$file"; then
echo -e "\033[1;32mOK\033[0m"
else
echo -e "\033[0;31mFAIL\033[0m"
missing+="$file "
fi
done
if [ "$missing" = "" ]; then
echo -e "\033[1;32mAll checks pass.\033[0m"
else
echo -e "\033[0;31mThe follwing files are missing copyright information.\033[0m"
fi
for file in $missing; do
echo " - $file"
done