Adjacent string literals of the same type should be on separate lines
- Dominant language
- Python
- Stars
- 14k
- Forks
- 904
- PR merge metrics
- No merged PRs in 30d
Description
Suppose I have:
```python
print("Line 1\n"
"Line 2\n"
"Line 3\n")
```
yapf (0.31.0) wants to format it as:
```python
print("Line 1\n" "Line 2\n" "Line 3\n")
```
I argue that this is clearly against the author's intention, and having adjacent string literals of the same type (i.e., both are unadorned double-quoted strings, both are unadorned single-quoted strings, both are raw strings, both are f-strings...) makes no sense since they could have been combined into a single string literal in that case.
If that reasoning isn't compelling enough, then alternatively check if a string literal ends with a `\n`, and never put an adjacent string literal to the right of it.
Contributor guide
Assessment
This issue has not been assessed yet.