diff options
author | jackpoz <giacomopoz@gmail.com> | 2020-04-04 22:13:32 +0200 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2020-04-05 19:10:57 +0200 |
commit | 4f88be63e7551288f37e51928614cf14d99b444f (patch) | |
tree | 02e7686adc4e24f44914d7427a6b67100325f92e | |
parent | 468ecb7252ea4eabd37e11b9ddbbb96ffd26bd7e (diff) |
CI/Circle CI: Add support to multiline regex
-rw-r--r-- | contrib/check_codestyle.sh | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/check_codestyle.sh b/contrib/check_codestyle.sh index 02f39285cd3..ce18db2d07e 100644 --- a/contrib/check_codestyle.sh +++ b/contrib/check_codestyle.sh @@ -4,12 +4,20 @@ set -e echo "Codestyle check script:" echo -regexChecks=("TC_LOG_.+GetCounter") +singleLineRegexChecks=("TC_LOG_.+GetCounter") +for check in ${singleLineRegexChecks[@]}; do + echo " Checking RegEx: '${check}'" + + if grep -P -r -I -n ${check} src; then + exit 1 + fi +done -for check in ${regexChecks[@]}; do +multiLineRegexChecks=("TC_LOG_[^;]+GetCounter") +for check in ${multiLineRegexChecks[@]}; do echo " Checking RegEx: '${check}'" - if grep -E -r ${check} src; then + if grep -Pzo -r -I ${check} src; then exit 1 fi done |