Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: not splitting two sentence summary into description #275

Open
jamesbraza opened this issue Jan 31, 2024 · 0 comments
Open

Bug: not splitting two sentence summary into description #275

jamesbraza opened this issue Jan 31, 2024 · 0 comments
Labels
fresh This is a new issue

Comments

@jamesbraza
Copy link

jamesbraza commented Jan 31, 2024

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
@github-actions github-actions bot added the fresh This is a new issue label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fresh This is a new issue
Projects
None yet
Development

No branches or pull requests

1 participant