tests/test-check-code
author Martin Geisler <mg@lazybytes.net>
Sun, 18 Apr 2010 15:47:49 +0200
changeset 10937 a9d5943d2a30
parent 10727 62b8f15683f2
child 11341 920a783e5f91
permissions -rwxr-xr-x
minirst: removed unnecessary initindent variable

#!/bin/sh
#cd `dirname $0`
cat > correct.py <<EOF
def toto(arg1, arg2):
    del arg2
    return (5 + 6, 9)
EOF

cat > wrong.py <<EOF
def toto( arg1, arg2):
    del(arg2)
    return ( 5+6, 9)
EOF

cat > quote.py <<EOF
# let's use quote in comments
(''' ( 4x5 )
but """\\''' and finally''',
"""let's fool checkpatch""", '1+2',
'"""', 42+1, """and
( 4-1 ) """, "( 1+1 )\" and ")
a, '\\\\\\\\', "\\\\\\" x-2", "c-1"
EOF

check_code=`dirname $0`/../contrib/check-code.py
${check_code} ./wrong.py ./correct.py ./quote.py