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
The signals import was removed because it wasn't used. I don't want it to be removed though, as the import has intentional side effects.
Removing unused import is an intentional behavior. rope can't know that you intend to use an import just for its side effect. ... It would also be reasonable if user can add a special comment markers (e.g. # rope: keep-unused-import) on imports lines to prevent rope from removing them during reorganization.
An example of what this might look like:
from mod_two import func_three # rope: keep-unused-import
or for multiline imports (alternative 1 - special comment only takes effect at the end):
from mod_one import (
func_one,
func_two,
) # rope: keep-unused-import
Or maybe we should do instead (alternative 2 - put it at the first line instead):
from mod_one import ( # rope: keep-unused-import
func_one,
func_two,
)
Additional acceptance criteria:
documentation
The text was updated successfully, but these errors were encountered:
lieryan
changed the title
Comment marker to tell OrganizeImport to keep unused imports
Comment marker to tell ImportOrganizer to keep unused imports
Sep 7, 2021
Background: #21
An example of what this might look like:
or for multiline imports (alternative 1 - special comment only takes effect at the end):
Or maybe we should do instead (alternative 2 - put it at the first line instead):
Additional acceptance criteria:
The text was updated successfully, but these errors were encountered: