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

Multi-line grid without parentheses #1434

Closed
nolar opened this issue Aug 30, 2020 · 3 comments
Closed

Multi-line grid without parentheses #1434

nolar opened this issue Aug 30, 2020 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@nolar
Copy link

nolar commented Aug 30, 2020

Thank you for this great project! The imports now look clean indeed.

A little feature request: maybe, it is also worth adding this mode for imports:

from some.pkg.mod import something, anything, \
                         thing3, thing4

I could not find how to configure it. The closest equivalent I found had the same "grid", but with parenthesis (multi_line_output = 0). The parentheses look like outliers when this statement is just one statement lengthy enough to be multiline — among several one-liners. A real-world example:

from kopf.engines import loggers, posting
from kopf.reactor import causation, daemons, effects, handling, lifecycles, registries
from kopf.storage import finalizers, states
from kopf.structs import (bodies, configuration, containers, diffs,
                          handlers as handlers_, patches, resources)

It would be better with:

from kopf.engines import loggers, posting
from kopf.reactor import causation, daemons, effects, handling, lifecycles, registries
from kopf.storage import finalizers, states
from kopf.structs import bodies, configuration, containers, diffs, \
                         handlers as handlers_, patches, resources
@timothycrosley timothycrosley added the enhancement New feature or request label Sep 1, 2020
timothycrosley added a commit that referenced this issue Sep 1, 2020
@timothycrosley
Copy link
Member

This has been implemented in develop as wrapping mode #11: https://github.com/PyCQA/isort#multi-line-output-modes and will be released to PyPI in version 5.5.0

Thanks!

~Timothy

@timothycrosley timothycrosley added this to the 5.5.0 milestone Sep 1, 2020
@timothycrosley
Copy link
Member

This change has just been deployed to PyPI in version 5.5.0

Thanks!

~Timothy

@nolar
Copy link
Author

nolar commented Sep 3, 2020

@timothycrosley Thanks for such a fast implementation! Applied in nolar/kopf#531 — looks awesome!

Before (mode 0):

image

After (mode 11):

image

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

No branches or pull requests

2 participants