comparison 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
comparison
equal deleted inserted replaced
27272:69308357ecd1 27273:5d5b98346fc2
451 if not fromlocal(prefix + n.name)] 451 if not fromlocal(prefix + n.name)]
452 else: 452 else:
453 symbols = [n.name for n in node.names] 453 symbols = [n.name for n in node.names]
454 454
455 if symbols and fullname not in allowsymbolimports: 455 if symbols and fullname not in allowsymbolimports:
456 yield msg('direct symbol import from %s', fullname) 456 yield msg('direct symbol import %s from %s',
457 ', '.join(symbols), fullname)
457 458
458 if symbols and seennonsymbolrelative: 459 if symbols and seennonsymbolrelative:
459 yield msg('symbol import follows non-symbol import: %s', 460 yield msg('symbol import follows non-symbol import: %s',
460 fullname) 461 fullname)
461 462