-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Faulty WARNING: Definition list ends without a blank line; unexpected indent
#11026
Comments
Another case: same problem, different warning: # -*- coding: utf-8 -*-
"""Yes."""
def A():
"""*a b""" points to module's, not
|
Had the same problem in my code base: https://earth.bsc.es/gitlab/es/autosubmit/-/merge_requests/316#note_199986 After seeing this issue, I searched for Cheers |
My initial thought is that changes in indentation level (unindent) need to be separated by blank lines. The following passes
|
I reproduced the example described at the top comment this morning, using Sphinx 6.1.3, the latest available at PyPI ATOW. (venv) (base) kinow@ranma:~/Development/python/workspace/dumdum/docs$ PYTHONPATH=.. sphinx-build -W -E . build
Running Sphinx v6.1.3
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [100%] index
Warning, treated as error:
/home/kinow/Development/python/workspace/dumdum/dummy_module/dumdum.py:docstring of dummy_module.dumdum.A:1:Definition list ends without a blank line; unexpected unindent. Then, on the same project, I installed Sphinx from a clone of this repository, latest commit commit 6809ca7d04da47f8780647296961934cdc07e14a (HEAD -> master, upstream/master, upstream/HEAD)
Author: Jean-François B <[email protected]>
Date: Fri Mar 31 23:58:48 2023 +0200
Fix error message wording in builders/latex/transforms.py
And make it and the two other ones there translatable strings.
Using .format for the f-string. and the bug was gone 🐛 🔨 💥 (venv) (base) kinow@ranma:~/Development/python/workspace/dumdum/docs$ PYTHONPATH=.. sphinx-build -W -E . build
Running Sphinx v6.2.0+/6809ca7d0
building [mo]: targets for 0 po files that are out of date
writing output...
building [html]: targets for 2 source files that are out of date
updating environment: [new config] 2 added, 0 changed, 0 removed
reading sources... [100%] index
Warning, treated as error:
/home/kinow/Development/python/workspace/dumdum/dummy_module/dumdum.py:docstring of dummy_module.dumdum.B:6:Definition list ends without a blank line; unexpected unindent. Using git bisect to find which commit fixed itUsing (venv) (base) kinow@ranma:~/Development/python/workspace/sphinx$ git bisect start --term-new=fixed --term-old=unfixed
(venv) (base) kinow@ranma:~/Development/python/workspace/sphinx$ git bisect fixed master
(venv) (base) kinow@ranma:~/Development/python/workspace/sphinx$ git bisect unfixed v6.1.3
Bisecting: 80 revisions left to test after this (roughly 6 steps)
[75da848573f8c057affb72a0c7b443f027bace64] LaTeX: streamline matters related to pict2e availability (venv) (base) kinow@ranma:~/Development/python/workspace/sphinx$ pip uninstall sphinx -y && pip install -e .
# another session, same venv, dumdum project
PYTHONPATH=.. sphinx-build -W -E . build
# visually inspect the line reported, then tell bisect whether it's fixed or unfixed Eventually the
So I believe this issue can be included in the 6.2.0 release as fixed 🎉 , with credits (and our thanks 🙇 ) to @jbms. Cheers, |
|
Describe the bug
Warning points to wrong line of wrong method.
In "How to reproduce" below, removing
Y
fromof function
B()
removes the warning, yet the warning saysNote the example is almost completely minimal, meaning changing anything in the code of
dumdum.py
will remove or change it, despite having nothing to do with the suggested warning. However I found that only removing theY
eliminates warnings for any subsequent changes.How to Reproduce
See full project:
conf.py
:dummy_module/dumdum.py
:Environment Information
text Platform: win32; (Windows-10-10.0.19045-SP0) Python version: 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:34:17) [MSC v.1929 64 bit (AMD64)]) Python implementation: CPython Sphinx version: 5.3.0 Docutils version: 0.17.1 Jinja2 version: 3.0.3
Sphinx extensions
['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
Additional context
Windows 10,
conda install -c conda-forge sphinx==5.3.0
conda info
conda list
pip freeze
The text was updated successfully, but these errors were encountered: