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

Style concern about continued-line strings #998

Closed
afreiberger opened this issue Aug 28, 2019 · 1 comment
Closed

Style concern about continued-line strings #998

afreiberger opened this issue Aug 28, 2019 · 1 comment

Comments

@afreiberger
Copy link

Operating system: Ubuntu Bionic 18.04
Python version: Python 3.6.8
Black version: 19.3b0-80-g3dc461a (packaged as a snap by Canonical IS team - snap install black-canonical-is --edge)
Does also happen on master: yes

I recently converted some code from 80 character to 120 character line lengths using black and found that a string continuation in the form of:

    print("string with {} vars "
    "issue".format(len(vars)))

will reduce to:
print("string with {} vars " "issue".format(len(vars)))

I expect that the two strings would be concattenated together with the interstitial space taken out such that the resulting line would be:

print("string with {} vars issue".format(len(vars)))

It may be that the current assumption is that the multi-line breaks are tuple/function arg passing with comma separation, rather than also considering the string appending use case I have above.

The resulting code is still valid and executes with replacing the proper variables, but I feel that reducing the close/open quotes around the joined lines would be preferable for style and character reduction on the resulting line.

@zsol
Copy link
Collaborator

zsol commented Sep 4, 2019

This is tracked in #26

@zsol zsol closed this as completed Sep 4, 2019
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

No branches or pull requests

2 participants