annotate tests/test-check-code.out @ 11341:920a783e5f91

check-code: fix check for any/all function The old check would only detect any/all at the beginning of a line. The regexp was probably just modeled after the preceding regexp which (correctly) finds the 'with' keyword at the beginning of a line. We now complain about 'any(' and 'all(' anywhere in a line, unless it is preceded by 'def'. This allows us to define our own compatibility wrapper in util and use 'util.any(' in the code.
author Martin Geisler <mg@aragost.com>
date Tue, 15 Jun 2010 09:51:52 +0200
parents 62b8f15683f2
children f325db39c8b9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10715
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
1 ./wrong.py:1:
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
2 > def toto( arg1, arg2):
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
3 gratuitous whitespace in () or []
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
4 ./wrong.py:2:
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
5 > del(arg2)
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
6 del isn't a function
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
7 ./wrong.py:3:
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
8 > return ( 5+6, 9)
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
9 missing whitespace in expression
83dce0f817f4 add a small test for contrib/check-code.py
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
10 gratuitous whitespace in () or []
10727
62b8f15683f2 check-code: more tests and more robust python filtering
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 10722
diff changeset
11 ./quote.py:5:
10722
c4fb2103e734 check-code: improve quote detection regexp, add tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 10715
diff changeset
12 > '"""', 42+1, """and
c4fb2103e734 check-code: improve quote detection regexp, add tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 10715
diff changeset
13 missing whitespace in expression
11341
920a783e5f91 check-code: fix check for any/all function
Martin Geisler <mg@aragost.com>
parents: 10727
diff changeset
14 ./non-py24.py:2:
920a783e5f91 check-code: fix check for any/all function
Martin Geisler <mg@aragost.com>
parents: 10727
diff changeset
15 > if any():
920a783e5f91 check-code: fix check for any/all function
Martin Geisler <mg@aragost.com>
parents: 10727
diff changeset
16 any/all not available in Python 2.4
920a783e5f91 check-code: fix check for any/all function
Martin Geisler <mg@aragost.com>
parents: 10727
diff changeset
17 ./non-py24.py:3:
920a783e5f91 check-code: fix check for any/all function
Martin Geisler <mg@aragost.com>
parents: 10727
diff changeset
18 > x = all()
920a783e5f91 check-code: fix check for any/all function
Martin Geisler <mg@aragost.com>
parents: 10727
diff changeset
19 any/all not available in Python 2.4