Smart newlines no longer skips multi-line string assignments
Prior to this change, the smart newline code was doing the wrong thing when
faced with code like this:
```
from x import y
something = """
test"""
class Blah():
pass
```
The smartnew lines code attempts to find the first construct after the import
block, and uses the `_skip_line` function to determine where that construct
starts. However, `_skip_line` seems to incorrectly assume that a line ending
with `"""` is a docstring. It then goes on to treat `class Blah` as the first
construct, and adds 2 new lines after imports instead of the 1 that should be
chosen.
I've fixed this by updating `_skip_lines` to stop iterating over the characters
of a line if it finds something that is neither whitespace, the start of a
string or a comment.
Loading
Please register or sign in to comment