Mercurial > public > mercurial-scm > hg-stable
diff contrib/check-code.py @ 38824:882ef6949bdc
check-code: ban use of bare xrange()
We want everyone to use pycompat.xrange().
Differential Revision: https://phab.mercurial-scm.org/D4033
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 01 Aug 2018 13:08:00 -0700 |
parents | 8fb9985382be |
children | c52a8af4052a |
line wrap: on
line diff
--- 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 [],