You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is there some way to not change the order of the import and the code before that import? #4
this is in fact a major shortcoming in the project right now, unfortunately, there should be another comment directive, perhaps something like #noqa nomove that prevents it from moving an import at all.
for now, for the few cases I have this problem, I use this workaround:
if True:
import django
django.setup()
from apps.model import Blah
or
import django
django.setup()
if True:
from apps.model import Blah
Activity
zzzeek commentedon Aug 25, 2019
hi there -
this is in fact a major shortcoming in the project right now, unfortunately, there should be another comment directive, perhaps something like
#noqa nomovethat prevents it from moving an import at all.for now, for the few cases I have this problem, I use this workaround:
or
zzzeek commentedon Aug 25, 2019
Basically it only moves top level imports so anything inside of "if True:" is not going to move and will be considered to be where the code starts.