Automatically wrap certain simple docstrings
Automatic line length wrapping is a huge can of worms.
This PR starts to address one isolated case where we can automatically solve line length wrapping, namely for some docstrings. Example:
class Account:
address: str = None
"""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."""
is automatically corrected to
class Account:
address: str = None
"""Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua."""
I'm guessing there's more checking that needs to happen (e.g. this might wrap things that we don't want, like reStructuredText values). This PR serves as a starting point.
I'm a little hesitant on this fix because splitting the first line across multiple lines creates some other lint errors 🤔 Namely, the first line is expected to be a single line, followed potentially by a multi-line body.
Going to close for now but this is something I'd be open to exploring. E.g., it could be nice to automatically wrap docstring bodies apart from the summary line.