Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

atom-python-isort runs on saved file, rather than editor content #34

@arl-o

Description

@arl-o

The expected behavior of 'python-isort:sortImports' is that it runs on the current editor's contents, using isort to directly convert text.

eg:

new_contents = SortImports(file_contents=old_contents).output

Instead, the sortImports function runs isort on 'getFilePath', which means that isort doesn't appear to do anything if the file has not been saved immediately before running sortImports.

I think it's probably bad form to directly edit the focused .py file, rather than changing the editor's contents, because it doesn't allow for the user to view and/or revert the changes that isort makes.

I'd be happy to update this behavior, if nobody else wants to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions