docformatter icon indicating copy to clipboard operation
docformatter copied to clipboard

Bug: not splitting two sentence summary into description

Open jamesbraza opened this issue 1 year ago • 0 comments

Please see the below Python snippet, I am using Python 3.11 with docformatter==1.7.5:

# a.py

def foo() -> None:
    """I am a first sentence this long. I am another sentence that I would like to be in summary."""

Running docformatter --black --close-quotes-on-newline a.py formats it to:

# a.py

def foo() -> None:
    """
    I am a first sentence this long.

    I am another sentence that I would like to be in summary.
    """

I understand why the summary line is being split, because it violates the 88-char summary wrap length. However, I would like docformatter to avoid splitting the summary into a description like so:

# a.py

def foo() -> None:
    """
    I am a first sentence this long. I am another sentence that I would like to be in
    summary.
    """

I think what this warrants is:

  • New arg --no-split-summary-description or --no-split-first-sentence
  • Or a new regex to split the first sentence with, which can be set to \n

jamesbraza avatar Jan 31 '24 23:01 jamesbraza