Yzena
/
Yc
2
1
Fork 0
Browse Source

Make the format.sh and lint.sh scripts work on individual files

Signed-off-by: Gavin Howard <gavin@yzena.com>
afl_persistent_mode
Gavin Howard 6 months ago
parent
commit
a4b826df66
Signed by: gavin
GPG Key ID: C08038BDF280D33E
  1. 12
      tools/format.sh
  2. 9
      tools/lint.sh

12
tools/format.sh

@ -25,10 +25,16 @@
scriptdir=$(dirname "$0")
fs=$(find "$scriptdir/.." -name "*.c" -or -name "*.h")
cd "$scriptdir/.."
printf '%s\n' "$fs" | xargs clang-format -i --style=file
if [ "$#" -gt 0 ]; then
files="$@"
else
files=$(find "." -name "*.c" -or -name "*.h")
fi
for f in $fs; do
printf '%s\n' "$files" | xargs clang-format -i --style=file
for f in $files; do
sed -i 's|^#else //|#else //|g' "$f"
done

9
tools/lint.sh

@ -25,9 +25,16 @@
scriptdir=$(dirname "$0")
files=$(find "$scriptdir/.." -name "*.c" -or -name "*.h")
cd "$scriptdir/.."
if [ "$#" -gt 0 ]; then
files="$@"
else
files=$(find "." -name "*.c" -or -name "*.h")
fi
for f in $files; do
case "$f" in
*src/*/os/windows/*) continue ;;
esac

Loading…
Cancel
Save