pydocstringformatter
pydocstringformatter copied to clipboard
`--max-line-length` doesn't work as expected
I ran pydocstringformatter --max-line-length=10 -w example.py
on the command line, expecting pydocstringformatter will change this:
"""Hello yeeeeeeeee."""
to this:
"""Hello yeee
eeeeee."""
But I didn't see any change. Did I do anything wrong with the command line?
Sorry I should have responded earlier to this. This should be fixed by using the --linewrap-full-docstring
option. This formatting option is not turned on by default but should wrap summaries like this!
Using --linewrap-full-docstring
only formats the summary, not the body. Is this the intended behavior?
Original docstring:
"""My docstring summary that is too long to fit in a single line.
This is the body that is longer than the summary but does not get formatted."""
Using pydocstringformatter --linewrap-full-docstring --max-line-length=30
leads to:
"""My docstring summary that
is too long to fit in a single
line.
This is the body that is longer than the summary but does not get formatted.
"""
This is correct. It is much harder to wrap bodies correctly. If you have a representative code base on which you use pydocstringformatter
I would be very open to using that to see how difficult it would be to wrap bodies correctly.
We could add it to our list of repositories to check for each PR and see how difficult it would be to implement this.
Being honest, I was just curious whether this was a bug or something expected. This came out while I was testing pydocstringformatter
on some small projects. Nothing that could be considered a representative code base. Sorry.