Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 13031:3da456d0c885
code style: prefer 'is' and 'is not' tests with singletons
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 22 Nov 2010 18:15:58 +0100 |
parents | 53391819f195 |
children | 637627f31c74 |
line wrap: on
line diff
--- a/contrib/check-code.py Mon Nov 22 17:57:11 2010 +0100 +++ b/contrib/check-code.py Mon Nov 22 18:15:58 2010 +0100 @@ -150,6 +150,8 @@ (r'ui\.(status|progress|write|note|warn)\([\'\"]x', "warning: unwrapped ui message"), (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"), ] pyfilters = [