diff options
author | Kargatum <dowlandtop@yandex.com> | 2021-05-31 16:03:00 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 11:03:00 +0200 |
commit | e3c1e739c635ca5c70efda60d97ec15b04f790d7 (patch) | |
tree | f4b0a2a2e16dcd43c6233a2c0f60ee6e10878eee /apps/ci | |
parent | 9b6c3c7d2c93673ef88f19b6120e7265ed426cdd (diff) |
feat(CI/Codestyle): add check core logs (#6012)
Diffstat (limited to 'apps/ci')
-rw-r--r-- | apps/ci/ci-codestyle.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/apps/ci/ci-codestyle.sh b/apps/ci/ci-codestyle.sh index 0477a9f487..c96a31df0e 100644 --- a/apps/ci/ci-codestyle.sh +++ b/apps/ci/ci-codestyle.sh @@ -5,13 +5,14 @@ echo "Codestyle check script:" echo declare -A singleLineRegexChecks=( + ["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 echo " Checking RegEx: '${check}'" - + if grep -P -r -I -n ${check} src; then echo echo "${singleLineRegexChecks[$check]}" @@ -19,5 +20,21 @@ for check in ${!singleLineRegexChecks[@]}; do fi done +declare -A multiLineRegexChecks=( + ["LOG_[^;]+GetCounter"]="Use ObjectGuid::ToString().c_str() method instead of ObjectGuid::GetCounter() when logging. Check the lines above" + ["\n\n\n"]="Multiple blank lines detected, keep only one. Check the files above" +) + +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" |