IAP GITLAB

Skip to content
Snippets Groups Projects
do-clang-format.py 438 B
Newer Older
#!/bin/bash

command="clang-format -style=file `find . -iregex '^.*\.\(cc\|h\)$' -not -path './ThirdParty/*'`"

if [ "$1" == "check" ];
then
    `! ${command}  -output-replacements-xml | grep -qc "<replacement "` || \
ralfulrich's avatar
ralfulrich committed
        { echo "format-check FAILED!"; exit 1; }
    echo "Congratulations: format-check succeeded"
elif [ "$1" == "apply" ];
then
else
    echo "please use: ./do-clang-format.sh [check] or [apply]"