aboutsummaryrefslogtreecommitdiff
path: root/contrib/check_codestyle.sh
blob: 2f9bd5ef09b19ab063f3a0bff791af565b0fbae3 (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
26
27
28
29
30
31
#!/bin/bash
set -e

echo "Codestyle check script:"
echo

singleLineRegexChecks=(
    "TC_LOG_.+GetCounter"
    "[[:blank:]]$"
    "\t"
)
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"