# HG changeset patch # User Augie Fackler # Date 1357067122 21600 # Node ID e1caaeb5a2edac2d5cb1b36c5d22f973329d4d4d # Parent e6db64abfa872c4ac2a62dd7450829d5b52b208e check-code: disallow defunct <> operator Added a test for that and one other python3 check in test-check-code.t. diff -r e6db64abfa87 -r e1caaeb5a2ed contrib/check-code.py --- a/contrib/check-code.py Tue Jan 01 13:04:40 2013 -0600 +++ b/contrib/check-code.py Tue Jan 01 13:05:22 2013 -0600 @@ -129,6 +129,7 @@ (r'(?\s', '<> operator is not available in Python 3+, use !='), (r'^\s*\t', "don't use tabs"), (r'\S;\s*\n', "semicolon"), (r'[^_]_\("[^"]+"\s*%', "don't use % inside _()"), diff -r e6db64abfa87 -r e1caaeb5a2ed tests/test-check-code.t --- a/tests/test-check-code.t Tue Jan 01 13:04:40 2013 -0600 +++ b/tests/test-check-code.t Tue Jan 01 13:05:22 2013 -0600 @@ -110,6 +110,18 @@ > class empty(): class foo() not available in Python 2.4, use class foo(object) [1] + $ cat > python3-compat.py << EOF + > foo <> bar + > reduce(lambda a, b: a + b, [1, 2, 3, 4]) + > EOF + $ "$check_code" python3-compat.py + python3-compat.py:1: + > foo <> bar + <> operator is not available in Python 3+, use != + python3-compat.py:2: + > reduce(lambda a, b: a + b, [1, 2, 3, 4]) + reduce is not available in Python 3+ + [1] $ cat > is-op.py < # is-operator comparing number or string literal