Closed leebrooks0 closed 9 years ago
According to the Google style guide
Within each grouping, imports should be sorted lexicographically, ignoring case, according to each module's full package path.
AIUI the "full package path" is basically the __name__
of it. (Ignoring the part where this can vary depending on run-time configuration such as sys.path.) For from django.contrib.auth import models as auth
this is django.contrib.auth.models
and this is the sort key is used in this plugin.
I would be willing to entertain alternative interpretations of this clause though :) For example this plugin already makes the decision not to ignore case in the import order as to avoid ambiguity.
I am using Google style imports:
Your linter complains about this and says I should swap the order around, but I am using another tool isort to do the sorting, so obviously one way or the other is the correct way, I am not sure which way it is?
i.e. is your linter correct to complain and isort has sorted incorrectly, or is isort correct in this scenario and your linter has picked up a false positive?