Files
mongo/dist/s_python
Keith Bostic e53807613b WT-1970: Split s_style into 3 scripts: basic style stays in s_style,
python style moves to s_python, and error return macro checks move into
s_label. The last one (s_label) is the one that has to be run all the
time, it detects serious errors.
2015-06-23 11:39:33 -04:00

28 lines
727 B
Bash

#! /bin/sh
# Python style checks.
t=__wt.$$
trap 'rm -f $t; exit 0' 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 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
}