google / google/yapf

Strange formatting result for string format

Open
#707 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

When I tried to reformat the code below:
```python
print(\
'Lorem ipsum dolor sit amet, consectetur adipisicing\
elit, sed do eiusmod %s incididunt %s labore' % (str(string1),str(string2)))
```

The **results** are very strange.

First reformatting result is:
```python
print(\
'Lorem ipsum dolor sit amet, consectetur adipisicing\
elit, sed do eiusmod %s incididunt %s labore' % (str(string1),str(string2)))
```

When reformatting again for the result code, yapf reformat like below:
```python
print(\
'Lorem ipsum dolor sit amet, consectetur adipisicing\
elit, sed do eiusmod %s incididunt %s labore' % (str(string1),str(string2)))
```

and again, again, .... it will continuously reformat like this.

Please check this issue. Thank you.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.