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