-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Improve the failure mode on an empty code-block directive #368
Comments
Yeah, it would be good to avoid this. I think it would be better to silently ignore the broken syntax. Your actual docs-building tool, or an rST linter, are better suited for detecting and reporting on such errors. Would you like to work on a PR? |
Yes, I'd love to! I'm not able to today, but maybe tomorrow or later this week |
sirosen
added a commit
to sirosen/blacken-docs
that referenced
this issue
Sep 11, 2024
adamchainz
pushed a commit
to sirosen/blacken-docs
that referenced
this issue
Oct 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python Version
3.11.9
Package Version
1.18.0
Description
While refactoring some docs, I accidentally separated a
.. code-block:: python
directive from the relevant indented code block.So my docs had the form:
The failure mode I got was a crash, which is, IMO, the correct result but the nature of the crash was not informative.
Trace (invoked via pre-commit):
I think that when there is no match for a code block, it would be nice to bomb out with an explicit
ValueError
which contains the filename in the message. e.g.,ValueError: docs/foo.rst has a code-block with no content
The text was updated successfully, but these errors were encountered: