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

Add always_wrap_multiple_from setting. #469

Closed
wants to merge 1 commit into from

Conversation

carljm
Copy link

@carljm carljm commented Sep 8, 2016

At Instagram we would like to switch to isort to enforce our imports coding style, but our style requires use of the "vertical - hanging indent" style for all import from statements with multiple names imported. It doesn't matter how long they would be on a single line, they should always be wrapped with each imported name on its own line. E.g. even if from foo import bar, baz easily fits within 80 characters, we always write it as:

from foo import (
    bar,
    baz,
)

The reason for this is that it minimizes pollution of git annotate and makes it easier to track down who added/removed a single import, and when.

This pull request adds an always_wrap_multiple_from boolean setting which implements this.

@ryabtsev
Copy link
Contributor

A similar setting is already there: "force_grid_wrap" (force from imports to be grid wrapped regardless of line length)

@carljm
Copy link
Author

carljm commented Sep 21, 2016

@ryabtsev Thanks! Looks like force_grid_wrap=true along with multi_line_output=3 does exactly what I want; just mis-led by "grid" in the setting name.

@carljm carljm closed this Sep 21, 2016
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

Successfully merging this pull request may close these issues.

None yet

2 participants