CI/Circle CI: Show codestyle instructions

Show a short comment about how to fix the codestyle errors
This commit is contained in:
jackpoz
2020-04-07 21:43:47 +02:00
parent 09b22fd4a5
commit dcd2ffdaf4

View File

@@ -4,28 +4,34 @@ set -e
echo "Codestyle check script:"
echo
singleLineRegexChecks=(
"TC_LOG_.+GetCounter"
"[[:blank:]]$"
"\t"
declare -A singleLineRegexChecks=(
["TC_LOG_.+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above"
["[[:blank:]]$"]="Remove whitespace at the end of the lines above"
["\t"]="Replace tabs with 4 spaces in the lines above"
)
for check in ${singleLineRegexChecks[@]}; do
for check in ${!singleLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -P -r -I -n ${check} src; then
echo
echo "${singleLineRegexChecks[$check]}"
exit 1
fi
done
multiLineRegexChecks=(
"TC_LOG_[^;]+GetCounter"
declare -A multiLineRegexChecks=(
["TC_LOG_[^;]+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above"
)
for check in ${multiLineRegexChecks[@]}; do
for check in ${!multiLineRegexChecks[@]}; do
echo " Checking RegEx: '${check}'"
if grep -Pzo -r -I ${check} src; then
echo
echo
echo "${multiLineRegexChecks[$check]}"
exit 1
fi
done
echo
echo "Everything looks good"