pawamoy / pawamoy/markdown-exec
feature: Raise `PluginError` on expected failed code execution
@pawamoy is already working on this.
Since Feb 20, 2025.
- Dominant language
- Python
- Stars
- 174
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
I would like to use the docs build execution as a way to check that the code in the docs is staying up to date with the underlying python library. For this to work the docs build must fail when the code raises an exception. That is, a code block containing raise ValueError should stop the docs build with a non-zero returncode.
Describe the solution you'd like
When a code block raises a value error unexpectedly (i.e. not indicated by the returncode option) throw a PluginError
I think this would amount to (maybe optionally) adding a line to this block:
Describe alternatives you've considered
I don't think there is an alternative method for this plugin.
Additional context
I think this could be configurable, even opt in. And it should still be possible to have errors, in the same way the shell code works.
I'm happy to make a PR implementing this if that's helpful
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.