docformatter icon indicating copy to clipboard operation
docformatter copied to clipboard

Automatic wrapping and force wrapping issues

Open thebuzzstop opened this issue 4 years ago • 1 comments

Long descriptions are not being wrapped as expected.

When I use the --force-wrap option the entire docstring is properly wrapped but a Sphinx param is also wrapped which is undesirable.

Usage:

  • docformatter v1.4 inside PyCharm
  • invoked as an external tool with the following command line
  • docformatter --force-wrap --wrap-descriptions 72 --wrap-summaries 79 --in-place --range 1014 1019 myfile.py

Here's a screenshot of the before: image

Here's a screenshot after running docformatter: image Note that the description was not line-wrapped.

Here's a screenshot after running docformatter with the --force-wrap option: image Note that the description was line-wrapped but the Sphinx param was also wrapped.

thebuzzstop avatar Jan 15 '21 22:01 thebuzzstop

docformatter's goal is to reformat docstrings in accordance with PEP-257. Sphinx directives are not really addressed by PEP-257. That said, Sphinx directives are ubiquitous in docstrings and docformatter should handle them properly. See also #78

weibullguy avatar Jul 24 '22 17:07 weibullguy