dncurrency/ci/clang-format-check.sh
theohax 6bff63efce
Redesign CI format check/update scripts according to review (#3486)
* Redesign CI format check/update scripts according to review

* Address code review #2
2021-09-30 10:37:09 +03:00

27 lines
767 B
Bash
Executable file

#!/usr/bin/env bash
###################################################################################################
source "$(dirname "$BASH_SOURCE")/impl/common.sh"
source "$(dirname "$BASH_SOURCE")/impl/clang-format.sh"
###################################################################################################
does_clang_format_exist
if [[ $? == 0 ]]; then
clang_format_check
result=$?
if [[ $result == 2 ]]; then
exit $result
fi
if [[ $result == 1 ]]; then
echo "Source code formatting differs from expected - please run ci/clang-format-do.sh"
exit 1
fi
echo "clang-format check passed"
fi
###################################################################################################