PyCQA / PyCQA/docformatter

Support for different line-wrapping conventions: no two sentences on the same line

Open
#123 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C: stakeholder P: enhancement U: low
Dominant language
Python
Stars
598
Forks
93
PR merge metrics
No merged PRs in 30d

Description

The following would be nice to have as an option: only wrap long lines, but do not join two subsequent sentences into one line.

For example:

This is a first sentence.
This is another long sentence, which should not be joined to the
previous one.

Having each sentence on its own line(s) makes it easier to visualize changes in text with git diff.
Otherwise, one small change in a long paragraph may cause many lines to be affected due to rewrapping of subsequent sentences, which makes the git diff output harder to process.

The each-sentence-on-its-own-line convention is something I got used to by working on LaTeX projects in Git, but it is such a nice improvement over rewrapping (manual or automatic), that I started using it in docstrings and markdown files as well.

I can imagine this would not be the preferred convention for everyone, but I would certainly use it, if it were an option.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating docformatter's line-wrapping implementation and existing option handling, then determine how sentence boundaries and configuration should work; done means an opt-in mode preserves sentence boundaries while wrapping long sentences and has coverage for the example behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.