python / python/blurb

Preserve indentation in multi-line list entry

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

Nobody has claimed this yet.

Dominant language
Python
Stars
22
Forks
13
Avg merge
4h 3m
Merged PRs (30d)
5

Description

I would like to put this in a NEWS entry:

The following `threading` methods are now deprecated and should be replaced:

- `threading.activeCount` => :func:`threading.active_count`

- `threading.Condition.notifyAll` =>
    :meth:`threading.Condition.notify_all`

But when blurb generates the NEWS file, it produces:

- bpo-43723: The following `threading` methods are now deprecated and should
  be replaced:

  - `threading.activeCount` => :func:`threading.active_count`

  - `threading.Condition.notifyAll` =>
  :meth:`threading.Condition.notify_all`

Which is invalid rst, because the second line of the list is not indented enough.

It's because blurb uses textwrap.wrap to reflow the text, and that function eats any leading space in the line. Fixing this might require doing something more RST-aware.

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

Start by locating blurb's use of Python's textwrap.wrap and reproduce the issue with the NEWS entry shown here. Trace how multiline list entries are reflowed, then verify that generated output preserves the indentation required for valid reStructuredText.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.