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

Long strings not broken? #2062

Closed
kierdavis opened this issue Mar 25, 2021 · 1 comment
Closed

Long strings not broken? #2062

kierdavis opened this issue Mar 25, 2021 · 1 comment
Labels
T: bug Something isn't working

Comments

@kierdavis
Copy link

Describe the bug

With #1132 merged, I would expect strings that are longer than the line length limit and are located as the value of a keyword argument to be broken into multiple lines, but I don't see this behaviour in practice.

To Reproduce

[user@host ~] pip install 'git+https://github.com/psf/black.git#egg=proj'
...
[user@host ~] black --version
black, version 20.8b1
[user@host ~] cat test.py
foo(
    bar="a really really really really really really really really really really really really really really really really really long string",
)
[user@host ~] black test.py
All done! ✨ 🍰 ✨
1 file left unchanged.
[user@host ~] cat test.py
foo(
    bar="a really really really really really really really really really really really really really really really really really long string",
)

Expected behavior

test.py to be reformatted to look like the examples in #1132, something like:

foo(
    bar=(
        "a really really really really really really really really really"
        " really really really really really really really really long string"
    ),
)

Environment (please complete the following information):

  • Version: master
  • OS and Python version: RHEL 7 + Python 3.6.8

Does this bug also happen on master?

Yes (both when installed locally and on black.now.sh).

@kierdavis kierdavis added the T: bug Something isn't working label Mar 25, 2021
@JelleZijlstra
Copy link
Collaborator

This is currently behind the --experimental-string-processing flag. We'll enable that by default once the feature is stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants