add format verification to contrib/format.sh

run with ./contrib/format.sh verify
exits with 0 if we are good, exits non-zero if we are not formatted right
pull/1640/head
Jeff Becker 3 years ago
parent 696c6d1b5a
commit 6e67f38408
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -16,6 +16,9 @@ if [ $? -ne 0 ]; then
fi
fi
# TODO: readlink -e is a GNU-ism
cd "$(readlink -e $(dirname $0)/../)"
$binary -i $(find jni daemon llarp include pybind | grep -E '\.[hc](pp)?$') &> /dev/null
cd "$(dirname $0)/../"
if [ "$1" = "verify" ] ; then
exit $($binary --output-replacements-xml $(find jni daemon llarp include pybind | grep -E '\.[hc](pp)?$' | grep -v '\#') | grep '</replacement>' | wc -l)
else
$binary -i $(find jni daemon llarp include pybind | grep -E '\.[hc](pp)?$' | grep -v '\#') &> /dev/null
fi

Loading…
Cancel
Save