mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-26 17:31:45 +02:00
Switch to GitHub Actions
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
This commit is contained in:

committed by
afayaz-feral

parent
6c60565f33
commit
ab06ba419e
@ -10,6 +10,21 @@ if [[ "$1" == "--pre-commit" ]]; then
|
||||
git-clang-format
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "$CI" == "true" ]]; then
|
||||
# used in ci, assumes clean repo
|
||||
clang-format -i $(find . -name '*.[ch]' -not -path "*subprojects/*")
|
||||
GIT_DIFF_OUTPUT=$(git diff)
|
||||
if [[ ! -z ${GIT_DIFF_OUTPUT} ]]; then
|
||||
echo "Failed clang format check:"
|
||||
echo "${GIT_DIFF_OUTPUT}"
|
||||
exit 1
|
||||
else
|
||||
echo "Passed clang format check"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
CLANG_FORMAT_OUTPUT=$(git-clang-format HEAD^ HEAD --diff)
|
||||
if [[ ! ${CLANG_FORMAT_OUTPUT} == "no modified files to format" ]] && [[ ! -z ${CLANG_FORMAT_OUTPUT} ]]; then
|
||||
echo "Failed clang format check:"
|
||||
@ -17,4 +32,5 @@ if [[ ! ${CLANG_FORMAT_OUTPUT} == "no modified files to format" ]] && [[ ! -z ${
|
||||
exit 1
|
||||
else
|
||||
echo "Passed clang format check"
|
||||
exit 0
|
||||
fi
|
||||
|
Reference in New Issue
Block a user