contrib/check-code.py
changeset 32418 1651977596c0
parent 32293 ca727147ff9f
child 32604 071423d0a584
equal deleted inserted replaced
32417:f40dc6f7c12f 32418:1651977596c0
   298     (r' [=!]=\s+(True|False|None)',
   298     (r' [=!]=\s+(True|False|None)',
   299      "comparison with singleton, use 'is' or 'is not' instead"),
   299      "comparison with singleton, use 'is' or 'is not' instead"),
   300     (r'^\s*(while|if) [01]:',
   300     (r'^\s*(while|if) [01]:',
   301      "use True/False for constant Boolean expression"),
   301      "use True/False for constant Boolean expression"),
   302     (r'(?:(?<!def)\s+|\()hasattr\(',
   302     (r'(?:(?<!def)\s+|\()hasattr\(',
   303      'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
   303      'hasattr(foo, bar) is broken on py2, use util.safehasattr(foo, bar) '
       
   304      'instead', r'#.*hasattr-py3-only'),
   304     (r'opener\([^)]*\).read\(',
   305     (r'opener\([^)]*\).read\(',
   305      "use opener.read() instead"),
   306      "use opener.read() instead"),
   306     (r'opener\([^)]*\).write\(',
   307     (r'opener\([^)]*\).write\(',
   307      "use opener.write() instead"),
   308      "use opener.write() instead"),
   308     (r'[\s\(](open|file)\([^)]*\)\.read\(',
   309     (r'[\s\(](open|file)\([^)]*\)\.read\(',