contrib/check-code.py
changeset 25142 24140873ca4c
parent 25141 3ea8d6b5e665
child 25148 3b5cd6f13dcc
equal deleted inserted replaced
25141:3ea8d6b5e665 25142:24140873ca4c
   215     (r'[^_]_\([ \t\n]*(?:"[^"]+"[ \t\n+]*)+%', "don't use % inside _()"),
   215     (r'[^_]_\([ \t\n]*(?:"[^"]+"[ \t\n+]*)+%', "don't use % inside _()"),
   216     (r"[^_]_\([ \t\n]*(?:'[^']+'[ \t\n+]*)+%", "don't use % inside _()"),
   216     (r"[^_]_\([ \t\n]*(?:'[^']+'[ \t\n+]*)+%", "don't use % inside _()"),
   217     (r'(\w|\)),\w', "missing whitespace after ,"),
   217     (r'(\w|\)),\w', "missing whitespace after ,"),
   218     (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
   218     (r'(\w|\))[+/*\-<>]\w', "missing whitespace in expression"),
   219     (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
   219     (r'^\s+(\w|\.)+=\w[^,()\n]*$', "missing whitespace in assignment"),
   220     (r'(?<!def)(\s+|^|\()next\(.+\)',
       
   221      'no next(foo) in Python 2.4 and 2.5, use foo.next() instead'),
       
   222     (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'
   220     (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?'
   223      r'((?:\n|\1\s.*\n)+?)\1finally:',
   221      r'((?:\n|\1\s.*\n)+?)\1finally:',
   224      'no yield inside try/finally in Python 2.4'),
   222      'no yield inside try/finally in Python 2.4'),
   225     (r'.{81}', "line too long"),
   223     (r'.{81}', "line too long"),
   226     (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
   224     (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),