Given the following code:
print('Hello World')
class SimpleTest(object):
def test_simple_addition(self):
pass
def test_complex(self):
pass
class Bar(object):
def say_hello(self):
pass
(with an empty line at the end of the document)
If you format selection with the cursor on the empty line at the end of the document, it will format the whole document, which it souldn't.
If you format selection with the cursor ON OR AFTER pass in say_hello, it will delete a lot of code.
If you format selection with the cursor at column 0 on pass line in say_hello, it will add an extra ':' between the class and function definition, which makes the code invalid.