google / google/yapf

Running yapf on this block of code blasts a closing paren off towards the moon.

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

Description

Running `yapf -i some_file.py` where `some_file.py` contains the following code:

Turns this
```
def some_function():
self.my_dictionary['some_member'] = \
self.some_method('This is a really long string that \
I need to split up with a backslash')
```

Into this
```
def some_function():
self.my_dictionary['some_member'] = \
self.some_method('This is a really long string that \
I need to split up with a backslash' )
```

And then turns the above into
```
def some_function():
self.my_dictionary['some_member'] = \
self.some_method('This is a really long string that \
I need to split up with a backslash' )
```

And so on and so fourth, creating an infinite formatting loop.

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.