Mercurial > public > mercurial-scm > hg-stable
diff contrib/import-checker.py @ 27273:5d5b98346fc2
import-checker: tell which symbol causes "direct symbol import"
This would be sometimes useful to understand why import-checker.py complains
about it.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 06 Dec 2015 14:28:35 +0900 |
parents | 69308357ecd1 |
children | b2226faead3f |
line wrap: on
line diff
--- a/contrib/import-checker.py Sun Dec 06 14:18:19 2015 +0900 +++ b/contrib/import-checker.py Sun Dec 06 14:28:35 2015 +0900 @@ -453,7 +453,8 @@ symbols = [n.name for n in node.names] if symbols and fullname not in allowsymbolimports: - yield msg('direct symbol import from %s', fullname) + yield msg('direct symbol import %s from %s', + ', '.join(symbols), fullname) if symbols and seennonsymbolrelative: yield msg('symbol import follows non-symbol import: %s',