diff options
author | jackpoz <giacomopoz@gmail.com> | 2020-04-07 21:43:47 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-01 01:07:15 +0100 |
commit | d0e1794d995666ec6dd4995c481327264399d340 (patch) | |
tree | ca4a7fe1b61a3f4b2bc6799f815569609dde9892 /contrib/check_codestyle.sh | |
parent | 55ef3366bbd72de8be82c3bef2ac6e6acb5476d0 (diff) |
CI/Circle CI: Show codestyle instructions
Show a short comment about how to fix the codestyle errors
(cherry picked from commit dcd2ffdaf4c358dbbab7915ab744871e5a7cc4ad)
Diffstat (limited to 'contrib/check_codestyle.sh')
-rw-r--r-- | contrib/check_codestyle.sh | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/contrib/check_codestyle.sh b/contrib/check_codestyle.sh index 2f9bd5ef09b..4787f2a19dc 100644 --- a/contrib/check_codestyle.sh +++ b/contrib/check_codestyle.sh @@ -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" |