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

Redundant quotes after joining strings #2737

Closed
haridsv opened this issue Dec 31, 2021 · 2 comments
Closed

Redundant quotes after joining strings #2737

haridsv opened this issue Dec 31, 2021 · 2 comments
Labels
F: strings Related to our handling of strings R: duplicate This issue or pull request already exists S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: style What do we want Blackened code to look like?

Comments

@haridsv
Copy link

haridsv commented Dec 31, 2021

Describe the style change

I am a first time user and ran black on code generated by Cookiecutter and noticed that a string literal that was split across lines was joined, but the extra quotes were left in and so this I feel will reduce readability. Here is the original code:

    click.echo("Replace this message by putting your code into "
               "testproject.cli.main")

Examples in the current Black style

    click.echo("Replace this message by putting your code into " "testproject.cli.main")

Desired style

    click.echo("Replace this message by putting your code into testproject.cli.main")

Additional context

Here is the full cli.py content that was generated by Cookiecutter:

"""Console script for testproject."""
import sys
import click


@click.command()
def main(args=None):
    """Console script for testproject."""
    click.echo("Replace this message by putting your code into "
               "testproject.cli.main")
    click.echo("See click documentation at https://click.palletsprojects.com/")
    return 0


if __name__ == "__main__":
    sys.exit(main())  # pragma: no cover
@haridsv haridsv added the T: style What do we want Blackened code to look like? label Dec 31, 2021
@ichard26 ichard26 added F: strings Related to our handling of strings S: accepted The changes in this design / enhancement issue have been accepted and can be implemented labels Dec 31, 2021
@ichard26
Copy link
Collaborator

Should be fixed when experimental-string-processing is enabled although that's blocked on various issues (see #2188 for more information) unfortunately.

@felix-hilden
Copy link
Collaborator

We can follow the linked issue, and since this is already implemented I'll close this for housekeeping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: strings Related to our handling of strings R: duplicate This issue or pull request already exists S: accepted The changes in this design / enhancement issue have been accepted and can be implemented T: style What do we want Blackened code to look like?
Projects
None yet
Development

No branches or pull requests

3 participants