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

Show repr of the value in warnings #10438

Closed
ezio-melotti opened this issue May 9, 2022 · 3 comments
Closed

Show repr of the value in warnings #10438

ezio-melotti opened this issue May 9, 2022 · 3 comments
Labels
type:proposal a feature suggestion

Comments

@ezio-melotti
Copy link
Contributor

Describe the bug

A markup like :ref:`Python <test >` results in this warning: WARNING: undefined label: test .
By looking at it in the terminal it's difficult to notice the trailing space.
By using the repr of the value instead, the warning will show WARNING: undefined label: 'test '.

How to Reproduce

:ref:`Python <test >`

Expected behavior

WARNING: undefined label: 'test ' instead of WARNING: undefined label: test .

Your project

Screenshots

No response

OS

Linux

Python version

3.10

Sphinx version

Sphinx v4.5.0

Sphinx extensions

No response

Extra tools

No response

Additional context

sphinx-contrib/sphinx-lint#27 (comment)

@tk0miya
Copy link
Member

tk0miya commented May 14, 2022

We can use a single quote for the label. So the "repr" form is a bit confusable. I'm not sure what is better message for a label including a single quote.

This is an example using repr():

/Users/tkomiya/work/tmp/doc/index.rst:6: WARNING: undefined label: "i\'m happy"

@ezio-melotti
Copy link
Contributor Author

See #10439 (comment).

@AA-Turner
Copy link
Member

#10439

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:proposal a feature suggestion
Projects
None yet
Development

No branches or pull requests

3 participants