diff options
author | jackpoz <giacomopoz@gmail.com> | 2020-04-07 21:43:47 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2020-04-07 21:43:47 +0200 |
commit | dcd2ffdaf4c358dbbab7915ab744871e5a7cc4ad (patch) | |
tree | 8c7c0756fa8b09159453b90349a84f4502811e02 | |
parent | 09b22fd4a50ec8cde19c449dade69d9e52d34e78 (diff) |
CI/Circle CI: Show codestyle instructions
Show a short comment about how to fix the codestyle errors
-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" |