view 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
line wrap: on
line source

./wrong.py:1:
 > def toto( arg1, arg2):
 gratuitous whitespace in () or []
./wrong.py:2:
 >     del(arg2)
 del isn't a function
./wrong.py:3:
 >     return ( 5+6, 9)
 missing whitespace in expression
 gratuitous whitespace in () or []
./quote.py:5:
 > '"""', 42+1, """and
 missing whitespace in expression
./non-py24.py:2:
 > if any():
 any/all not available in Python 2.4
./non-py24.py:3:
 >     x = all()
 any/all not available in Python 2.4