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

Consider requiring a uniform quote style for implicit string concatenations #8265

Open
charliermarsh opened this issue Oct 26, 2023 · 2 comments
Labels
formatter Related to the formatter style How should formatted code look

Comments

@charliermarsh
Copy link
Member

Given a string concatenation, the formatter currently determines the quote style for each segment individually, which can result in different segments using different quote styles.

I believe this is consistent with Black, but I don't know that it's the right decision... For example, it means that if you move content between the segments, you may have to change quotes.

We explicitly avoid this in our flake8-quotes rule (#2400). Let's at least consider doing the same here.

@charliermarsh charliermarsh added the formatter Related to the formatter label Oct 26, 2023
@MichaReiser
Copy link
Member

MichaReiser commented Oct 26, 2023

I believe this is consistent with Black, but I don't know that it's the right decision... For example, it means that if you move content between the segments, you may have to change quotes.

To clarify: Do you mean our behavior is consistent with Black or using a single quote style for an entire string is consistent with black?

I prefer keeping it as is, at least for now, to ease adoption coming from black.

Black

@MichaReiser MichaReiser added the needs-decision Awaiting a decision from a maintainer label Oct 26, 2023
@charliermarsh
Copy link
Member Author

To clarify: Do you mean our behavior is consistent with Black or using a single quote style for an entire string is consistent with black?

I mean our behavior is consistent with Black.

@MichaReiser MichaReiser added style How should formatted code look and removed needs-decision Awaiting a decision from a maintainer labels Oct 26, 2023
@MichaReiser MichaReiser added this to the Formatter: Stable milestone Nov 28, 2023
@MichaReiser MichaReiser removed this from the Formatter: Stable milestone Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
formatter Related to the formatter style How should formatted code look
Projects
None yet
Development

No branches or pull requests

2 participants