Files
TrinityCore/contrib/check_codestyle.sh
jackpoz 5f29577f63 CI/Circle CI: Add codestyle check
Tabs are not allowed, use 4 spaces instead
2020-04-05 19:11:00 +02:00

32 lines
540 B
Bash

#!/bin/bash
set -e
echo "Codestyle check script:"
echo
singleLineRegexChecks=(
"TC_LOG_.+GetCounter"
"[[:blank:]]$"
"\t"
)
for check in ${singleLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -P -r -I -n ${check} src; then
exit 1
fi
done
multiLineRegexChecks=(
"TC_LOG_[^;]+GetCounter"
)
for check in ${multiLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -Pzo -r -I ${check} src; then
exit 1
fi
done
echo "Everything looks good"