Mercurial > hg > mercurial-source
changeset 33387:071423d0a584
check-code: suggest policy.importmod
This forbids patterns like `from mercurial.cext import parsers` which breaks
pure.
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 31 May 2017 11:41:54 -0700 |
parents | 5d44d7d4076e |
children | e6ff007e107e |
files | contrib/check-code.py |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -340,6 +340,8 @@ (r'^import pickle', "don't use pickle, use util.pickle"), (r'^import httplib', "don't use httplib, use util.httplib"), (r'^import BaseHTTPServer', "use util.httpserver instead"), + (r'^(from|import) mercurial\.(cext|pure|cffi)', + "use mercurial.policy.importmod instead"), (r'\.next\(\)', "don't use .next(), use next(...)"), (r'([a-z]*).revision\(\1\.node\(', "don't convert rev to node before passing to revision(nodeorrev)"),