mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-18 18:13:09 +00:00
* mv src -> ext, lib -> src to be more in line with PHP module expectations * Fixed dependency for ffi test * Fixed path in format-check to C source * CRT will now try the extension first, then FFI
25 lines
482 B
Bash
Executable File
25 lines
482 B
Bash
Executable File
#!/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 ext -type f \( -name '*.h' -o -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
|