contrib/check-code.py
changeset 14494 1ffeeb91c55d
parent 14303 e2be0bba0d83
child 14549 48ec0763afbb
equal deleted inserted replaced
14493:5cc7905bccc9 14494:1ffeeb91c55d
   161      "wrong whitespace around ="),
   161      "wrong whitespace around ="),
   162     (r'raise Exception', "don't raise generic exceptions"),
   162     (r'raise Exception', "don't raise generic exceptions"),
   163     (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
   163     (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
   164     (r' [=!]=\s+(True|False|None)',
   164     (r' [=!]=\s+(True|False|None)',
   165      "comparison with singleton, use 'is' or 'is not' instead"),
   165      "comparison with singleton, use 'is' or 'is not' instead"),
       
   166     (r'^\s*(while|if) [01]:',
       
   167      "use True/False for constant Boolean expression"),
   166     (r'opener\([^)]*\).read\(',
   168     (r'opener\([^)]*\).read\(',
   167      "use opener.read() instead"),
   169      "use opener.read() instead"),
   168     (r'opener\([^)]*\).write\(',
   170     (r'opener\([^)]*\).write\(',
   169      "use opener.write() instead"),
   171      "use opener.write() instead"),
   170     (r'[\s\(](open|file)\([^)]*\)\.read\(',
   172     (r'[\s\(](open|file)\([^)]*\)\.read\(',