If a class, method or function is stub out with an ellipsis (...), black gives them their own line in python files and appends them end-of-line after the colon in stub files:
scratch.py
class Animal:
...
class Cat(Animal):
def meow(self):
...
def f():
...
scratch.pyi
class Animal: ...
class Cat(Animal):
def meow(self): ...
def f(): ...