aboutsummaryrefslogtreecommitdiff
path: root/contrib/check_codestyle.sh
blob: ee1ab09f2192857499924d131f96c5ddd72a28e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
set -e

echo "Codestyle check script:"
echo

singleLineRegexChecks=("TC_LOG_.+GetCounter" "[[:blank:]]$")
for check in ${singleLineRegexChecks[@]}; do
    echo "  Checking RegEx: '${check}'"
    
    if grep -P -r -I -n ${check} src; then
        exit 1
    fi
done

multiLineRegexChecks=("TC_LOG_[^;]+GetCounter")
for check in ${multiLineRegexChecks[@]}; do
    echo "  Checking RegEx: '${check}'"
    
    if grep -Pzo -r -I ${check} src; then
        exit 1
    fi
done

echo "Everything looks good"