Make it possible to turn *some* warnings into errors
#7,949 opened on 2020年7月13日
Repository metrics
- Stars
- (5,625 stars)
- PR merge metrics
- (平均マージ 10d 11h) (30d で 11 merged PRs)
説明
We have a non-trivial doc build where legitimate warnings can be emitted for various reasons, especially on a developer's machine where some software components may be disabled and autodoc will therefore fail emitting for them. However, some other warnings point to errors in the written documentation itself, and would ideally fail a doc build. I'm thinking especially of reST parsing errors.
Ideally there would be a way in the Sphinx configuration file to define some warning categories that will be turned into errors, and ultimately fail the doc build. This would prevent developers from checking in regression in the docs.
We could instead use suppress_warnings on the non-critical issues, and then use -W to turn the remaining warnings into errors. But I don't want to silence those non-critical warnings, it is still useful to have them emitted on a developer's machine.
So a new configuration key such as:
warnings_as_errors = [ ... ]
would certainly work for us (assuming that all standard warnings get a well-defined category, e.g. reST parsing errors).