Skip to content

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

@ucodery

Description

@ucodery

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions