check-code: ban use of bare xrange()
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 01 Aug 2018 13:08:00 -0700
changeset 38784 882ef6949bdc
parent 38783 e7aa113b14f7
child 38785 fb9121ea38c4
check-code: ban use of bare xrange() We want everyone to use pycompat.xrange(). Differential Revision: https://phab.mercurial-scm.org/D4033
contrib/check-code.py
--- a/contrib/check-code.py	Wed Aug 01 13:00:45 2018 -0700
+++ b/contrib/check-code.py	Wed Aug 01 13:08:00 2018 -0700
@@ -511,6 +511,7 @@
     (r'getopt\.getopt', "use pycompat.getoptb instead (py3)"),
     (r'os\.getenv', "use encoding.environ.get instead"),
     (r'os\.setenv', "modifying the environ dict is not preferred"),
+    (r'(?<!pycompat\.)xrange', "use pycompat.xrange instead (py3)"),
   ],
   # warnings
   [],