1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
Oinktube/vendor/aws/aws-crt-php/format-check.sh
2021-11-08 13:53:37 -03:00

24 lines
471 B
Bash

#!/bin/bash
if [[ -z $CLANG_FORMAT ]] ; then
CLANG_FORMAT=clang-format
fi
if NOT type $CLANG_FORMAT 2> /dev/null ; then
echo "No appropriate clang-format found."
exit 1
fi
FAIL=0
SOURCE_FILES=`find src ext -type f \( -name '*.c' \)`
for i in $SOURCE_FILES
do
$CLANG_FORMAT -output-replacements-xml $i | grep -c "<replacement " > /dev/null
if [ $? -ne 1 ]
then
echo "$i failed clang-format check."
FAIL=1
fi
done
exit $FAIL