sphinx-doc/sphinx

Warning handling for the build-finished event for -W

felix-hilden opened this issue · 1 comments

Is your feature request related to a problem? Please describe.
I'd like to issue warnings in build-finished. Currently, they aren't converted to errors with -W (ref: felix-hilden/sphinx-codeautolink#100). But my extension deals with the result HTML, so there's nowhere else that I can place the logic.

Describe the solution you'd like
I'd like for -W to raise the warnings in all build steps as expected.

Describe alternatives you've considered

  • Implement extension logic elsewhere: surely often possible, but unfortunately not in this case
  • Keep not raising: again, it's not often that a cleanup step would warn, but I can see it being potentially useful in other scenarios as well. Although in most of those cases you'd just raise an error.

Additional context
I found the relevant source in build. The logic looks solid, because build-finished should be emitted regardless of error state. And if you'd like to have the warning summary messages before that like it is currently without including build-finished, it's completely fine by me. I just want them to be converted to errors.

Also, feel free to just close this if you're keen on keeping the current behavior 😄 But I'd like to know why!

I posted the fix for this as #10114. Could you try this please?