sphinx-doc / sphinx-doc/sphinx

would be nice to get absolute line numbers in warnings

Open
#6,036 7 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

extensions:autodoc type:enhancement
Dominant language
Python
Stars
8k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

When Sphinx produces a warning like the following, one must add two numbers to determine the absolute line number in the module:

docstring of mymath.find_root:212: WARNING: Block quote ends without a blank line; unexpected unindent.

It would be wonderful if there were an option to get absolute line numbers rather than line numbers relative to the start of the given doc string.

Contributor guide

Open the contributing guide

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, so first locate the warning-generation path in Sphinx and determine where docstring-relative line numbers are computed. Done means an option produces absolute module line numbers in warnings, including the shown block-quote warning.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.