diff contrib/check-code.py @ 14494:1ffeeb91c55d

check-code: flag 0/1 used as constant Boolean expression
author Martin Geisler <mg@lazybytes.net>
date Wed, 01 Jun 2011 12:38:46 +0200
parents e2be0bba0d83
children 48ec0763afbb
line wrap: on
line diff
--- a/contrib/check-code.py	Tue May 31 20:39:04 2011 -0500
+++ b/contrib/check-code.py	Wed Jun 01 12:38:46 2011 +0200
@@ -163,6 +163,8 @@
     (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
     (r' [=!]=\s+(True|False|None)',
      "comparison with singleton, use 'is' or 'is not' instead"),
+    (r'^\s*(while|if) [01]:',
+     "use True/False for constant Boolean expression"),
     (r'opener\([^)]*\).read\(',
      "use opener.read() instead"),
     (r'opener\([^)]*\).write\(',