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

Formatter: single quote style converts triple single quotes to double quotes anyway #8252

Closed
henryiii opened this issue Oct 26, 2023 · 3 comments

Comments

@henryiii
Copy link
Contributor

I was moving pypa/build to Ruff format in pypa/build#696, since it's a single quote package, and it was previously handed by Black + pre-commit-hook's double to single quotes option. But it turns out Ruff converts triple quoted strings to double quotes even if single quotes is selected via quote-style = "single":

def foo():
    '''
    Single quotes.
    ''''

    return '''foo''' + 'bar'

Gets turned into:

def foo():
    """
    Single quotes.
    """

    return """foo""" + 'bar'
@T-256
Copy link
Contributor

T-256 commented Oct 26, 2023

dup #7615

@henryiii
Copy link
Contributor Author

Okay, closing as dup.

@henryiii henryiii closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
@charliermarsh
Copy link
Member

@henryiii - We ended up changing the behavior (during the alpha) such that we always use double quotes for multiline strings. Also relevant is the discussion in here (#7525) around supporting a quote-style = "preserve".

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

3 participants