Open MichaelBroughton opened 2 years ago
+1 to cleaning up import ...
vs from ... import ...
styles.
I'd add that having the formatting script also sort imports would be helpful (alphabetizing, grouping and ordering stdlib vs 3rd party vs cirq imports, etc). We have had good luck using isort internally.
Hi, could I grab this issue?
@smadhuk I've assigned it to you?
Is your feature request related to a use case or problem? Please describe. Right now a lot of modules (in particular tests) are pretty free form with how they do imports. It's a good practice to import modules wherever possible.
bad:
good:
Describe the solution you'd like We should add a new plugin to pylint (or install an existing one) that catches non module imports where it makes sense. Some exceptions might be
__init__
modules or typing imports and vendor modules that should just doimport cirq
everywhere.