mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
CI/Circle CI: Show codestyle instructions
Show a short comment about how to fix the codestyle errors
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user