summaryrefslogtreecommitdiff
path: root/dist/s_python
blob: bfe3ba57783eaaa0c2cc96509a5b4d2869ff4f6d (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
#! /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.
egrep '	' `find . -name '*.py'` |
    sed -e 's/:.*//' \
	-e '/__init__.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