summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/dist/s_python
blob: 5ba872d62f893ea9403f82840cd64e057bca3866 (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/sh

# Python style checks.
t=__wt.$$
trap 'rm -f $t' 0 1 2 3 13 15

cd ..

# Check Python coding standards: check for tab characters.
# Ignore generated files.
egrep '	' `find . -name '*.py' -not -path '*.git/*'` |
    sed -e 's/:.*//' \
    -e '/swig_wiredtiger.py/d' \
    -e '/\/wiredtiger.py/d' \
    -e '/src\/docs\/tools\/doxypy.py/d' |
    sort -u |
    sed 's/^/	/' > $t
test -s $t && {
    echo '[tab] characters appear in Python scripts:'
    cat $t
}
# Check Python coding standards: check for uncommented trailing semi-colons.
# Don't check too widely, there are third-party tools that fail this test as
# well as scripts in this directory that output C code, and so fail the test.
egrep '^[^#]*;$' `find lang test -name '*.py'`> $t
test -s $t && {
    echo 'trailing semi-colons in selected Python code:'
    cat $t
}

exit 0