Open lieryan opened 7 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.98%. Comparing base (
54433b8
) to head (0789b81
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Just tested this, it works nicely and results in much smaller diffs :) thanks!
@lieryan it would be pretty awesome to be able to use this. Is there something that prevents it from being merged? Anything we could contribute with?
Description
Added a new setting (
imports.preferred_import_style
) that controls how rope inserts new import statements.It can be set to:
normal-import
(default) which will insert imports asimport <package>
from-module
which will insert imports asfrom <package> import <module>
from-global
which will insert imports asfrom <package>.<module> import <object>
Credit: the solution here is based on nicoolas25's work on #696, but implements the config settings in a slightly different way.
Checklist (delete if not relevant):