Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--keep-direct-and-as options should be removed #1192

Closed
ucodery opened this issue May 7, 2020 · 2 comments
Closed

--keep-direct-and-as options should be removed #1192

ucodery opened this issue May 7, 2020 · 2 comments
Milestone

Comments

@ucodery
Copy link
Collaborator

ucodery commented May 7, 2020

This setting now defaults to True, so there is no point in setting it in the shell. It should be marked deprecated and then removed after a few minor releases.

Additionally, there is no mirror to this option (--discard-direct-with-as if you will), and it is not listed as a configurable setting in the wiki (although the tests suggest that it would work if added to a config). The only sure way to get the old behavior is to use the api directly. For these reasons I would suggest also removing keep_direct_and_as_imports from isort code as a whole. IMHO this setting just has the ability to introduce bugs. The following simple script would break if keep_direct_and_as_imports was set to False, for instance in an upstream commit hook.

from os import path
import os.path as pth

def foo(bar):
    return path.pathsep.join(bar)
@timothycrosley
Copy link
Member

Thanks for reporting! This is fixed in develop and slated to be released in the 5.1.0 minor release by the end of the month

@timothycrosley
Copy link
Member

A fix for this has been deployed to PyPI in the 5.1.0 release,

Thanks for reporting!

~Timothy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants