D4033: check-code: ban use of bare xrange()
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Wed Aug 1 20:10:38 UTC 2018
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
We want everyone to use pycompat.xrange().
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4033
AFFECTED FILES
contrib/check-code.py
CHANGE DETAILS
diff --git a/contrib/check-code.py b/contrib/check-code.py
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -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
[],
To: indygreg, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list