--- a/contrib/check-code.py Wed Dec 01 18:47:40 2010 -0600
+++ b/contrib/check-code.py Fri Dec 03 11:23:38 2010 +0100
@@ -8,6 +8,7 @@
# GNU General Public License version 2 or any later version.
import re, glob, os, sys
+import keyword
import optparse
def repquote(m):
@@ -136,6 +137,8 @@
(r'(?<!def)\s+(callable)\(',
"callable not available in Python 3, use hasattr(f, '__call__')"),
(r'if\s.*\selse', "if ... else form not available in Python 2.4"),
+ (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist),
+ "gratuitous whitespace after Python keyword"),
(r'([\(\[]\s\S)|(\S\s[\)\]])', "gratuitous whitespace in () or []"),
# (r'\s\s=', "gratuitous whitespace before ="),
(r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=)\S',