Show More
@@ -1,37 +1,39 | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 | #cd `dirname $0` |
|
2 | #cd `dirname $0` | |
3 | cat > correct.py <<EOF |
|
3 | cat > correct.py <<EOF | |
4 | def toto(arg1, arg2): |
|
4 | def toto(arg1, arg2): | |
5 | del arg2 |
|
5 | del arg2 | |
6 | return (5 + 6, 9) |
|
6 | return (5 + 6, 9) | |
7 | EOF |
|
7 | EOF | |
8 |
|
8 | |||
9 | cat > wrong.py <<EOF |
|
9 | cat > wrong.py <<EOF | |
10 | def toto( arg1, arg2): |
|
10 | def toto( arg1, arg2): | |
11 | del(arg2) |
|
11 | del(arg2) | |
12 | return ( 5+6, 9) |
|
12 | return ( 5+6, 9) | |
13 | EOF |
|
13 | EOF | |
14 |
|
14 | |||
15 | cat > quote.py <<EOF |
|
15 | cat > quote.py <<EOF | |
16 | # let's use quote in comments |
|
16 | # let's use quote in comments | |
17 | (''' ( 4x5 ) |
|
17 | (''' ( 4x5 ) | |
18 | but """\\''' and finally''', |
|
18 | but """\\''' and finally''', | |
19 | """let's fool checkpatch""", '1+2', |
|
19 | """let's fool checkpatch""", '1+2', | |
20 | '"""', 42+1, """and |
|
20 | '"""', 42+1, """and | |
21 | ( 4-1 ) """, "( 1+1 )\" and ") |
|
21 | ( 4-1 ) """, "( 1+1 )\" and ") | |
22 | a, '\\\\\\\\', "\\\\\\" x-2", "c-1" |
|
22 | a, '\\\\\\\\', "\\\\\\" x-2", "c-1" | |
23 | EOF |
|
23 | EOF | |
24 |
|
24 | |||
25 | cat > non-py24.py <<EOF |
|
25 | cat > non-py24.py <<EOF | |
26 | # Using builtins that does not exist in Python 2.4 |
|
26 | # Using builtins that does not exist in Python 2.4 | |
27 | if any(): |
|
27 | if any(): | |
28 | x = all() |
|
28 | x = all() | |
29 | y = format(x) |
|
29 | y = format(x) | |
30 |
|
30 | |||
31 | # Do not complain about our own definition |
|
31 | # Do not complain about our own definition | |
32 | def any(x): |
|
32 | def any(x): | |
33 | pass |
|
33 | pass | |
34 | EOF |
|
34 | EOF | |
35 |
|
35 | |||
36 | check_code=`dirname $0`/../contrib/check-code.py |
|
36 | check_code=`dirname $0`/../contrib/check-code.py | |
37 | ${check_code} ./wrong.py ./correct.py ./quote.py ./non-py24.py |
|
37 | ${check_code} ./wrong.py ./correct.py ./quote.py ./non-py24.py | |
|
38 | ||||
|
39 | exit 0 |
General Comments 0
You need to be logged in to leave comments.
Login now