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 are kept while formatting a string from multiple lines to one #14472

Closed
yury-fedotov opened this issue Nov 20, 2024 · 3 comments

Comments

@yury-fedotov
Copy link
Contributor

Description

Ruff formatter seems to keep redundant quotes at the edges of lines when collapsing them into one line.

P.S. Maybe it's me not using multiline strings properly, and current behavior is expected.

MRE

With line-length set at 100, running ruff format gives this diff:

- st.warning(
-     "This page is not implemented yet,"
-     " and is just a placeholder to test navigation."
- )
+ st.warning("This page is not implemented yet," " and is just a placeholder to test navigation.")

With redundant " " in the middle.

References and context

  • List of keywords you searched for before creating this issue: multiline
  • The command you invoked: ruff format
  • The current Ruff version: 0.7.1
@dylwil3
Copy link
Collaborator

dylwil3 commented Nov 20, 2024

Would the lint rule ISC001 achieve what you're after here?

@yury-fedotov
Copy link
Contributor Author

Would the lint rule ISC001 achieve what you're after here?

Good point! Let me close the issue then - I think the solution against this problem is as you stated, just use ISC001.

@yury-fedotov yury-fedotov closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2024
@MichaReiser
Copy link
Member

Ruff's formatter will join the two strings in an upcoming release early next year. See #13663

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