save
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
#!/bin/env bash
|
||||
|
||||
# Usage: ./Cleanup [FILE]...
|
||||
|
||||
make dist-clean
|
||||
|
||||
process_file() {
|
||||
clang-format -i "$1"
|
||||
tools/check_header_footer "$1"
|
||||
}
|
||||
|
||||
if [[ $# -gt 0 ]]; then
|
||||
for file in "$@"; do
|
||||
process_file "$file"
|
||||
done
|
||||
else
|
||||
for file in $(find yait core -type f \( -name "*.c" -o -name "*.h" \)); do
|
||||
process_file "$file"
|
||||
done
|
||||
fi
|
||||
@@ -1,44 +0,0 @@
|
||||
#!/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
|
||||
0
tools/format
Normal file → Executable file
0
tools/format
Normal file → Executable file
Reference in New Issue
Block a user