format with .uncrustify.cfg (#1759)

* format with .uncrustify.cfg

format with .uncrustify.cfg

* format with .uncrustify.cfg

* format with .uncrustify.cfg exclude json.* base64.* uthash.h

* format with .uncrustify.cfg exclude json.* base64.* uthash.h
This commit is contained in:
星野ハジメ
2017-10-30 21:28:53 +08:00
committed by Max Lv
parent 26ae365f7b
commit cc1bb4cf62
22 changed files with 501 additions and 419 deletions
Executable
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
root=$(pwd)
source="$root"/src
function format() {
filelist=$(ls "$1")
pushd "$1"
for file in $filelist; do
if test -d "$file"; then
echo "format directory $file"
format "$file"
else
if ([ "${file%%.*}" != "base64" ] &&
[ "${file%%.*}" != "json" ] &&
[ "${file%%.*}" != "uthash" ]) &&
([ "${file##*.}" = "h" ] || [ "${file##*.}" = "c" ]); then
echo "format file $file"
uncrustify -c "$root"/.uncrustify.cfg -l C --replace --no-backup "$file"
rm ./*.uncrustify >/dev/null 2>&1
fi
fi
done
popd
}
format "$source"