PyCQA / PyCQA/docformatter

Add option to avoid breaking a single word into a new line

Open
#241 1 comment 1 reaction 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

I don't know in which formatter I saw this (might have been ruff but can't find it there anymore), but one of them has this really nice feature that minor max-line-length violations are acceptable, if wrapping would result in ugliness. In particular this means that it will
not auto-wrap a comment if the next line would contain just one word. It would either wrap earlier (to have 2-3 words in the new line) or accept that the line will be slightly longer than the usual maximum.

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 implementation files, tests, or entry points. Start by locating the formatter’s existing max-line-length wrapping logic and its tests; clarify whether avoiding a one-word final line should permit an overlong line or trigger an earlier break, then add coverage for the chosen behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.