-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
needs_warnings not returning error code or writing to error log #344
Comments
Thanks for the great bug reports. It helps a lot. To be honest, I thought It is true, that the output of the single warning checks are producing a normal The used logger is coming from sphinx. Will check, if raising an exception or even a specific |
You are right. I observed too that the below statement would be present in the logfile What would be nice if all |
For the warning message to error log: We can have a config option So the first not passed warning will stop the build if used together with |
@danwos @haiyangToAI Thanks for the analysis on exit code and the feature for writing warnings to error log. @danwos I wanted to verify again the part about exit code which you mentioned.
The sphinx documentation mentions this however differently (see below or here). Here is it mentioned that an exit status of 1 will be raised. Is this then a Sphinx bug?
|
@danwos @twodrops I checked again about exit code when there are warnings. I tried two tests folder
|
@haiyangToAI I tried to look into |
@twodrops sorry for the confusion of those two test example. The difference between the two above is:
Then I realized, it seems not a valid comparison and a little confusion. I tried to look into again. Here is the conclusion: When using
In a word, return code only depends on Sphinx warning when using Example of Sphinx warning can be like this: |
Thanks @haiyangToAI for the detailed explanation. It would be nice to find out why sphinx-needs warnings behaves differently to sphinx-warnings.
The problem is that we cannot break pipelines for sphinx-needs warnings without this behavior. |
@haiyangToAI @danwos How can we conclude this topic? My current understanding from the above discussion is that, sphinx-needs warnings (or in general warnings thrown by sphinx extensions?) are treated differently compared to sphinx warnings. Is this an issue coming sphinx or sphinx-needs? |
@danwos Any clue on this? |
@haiyangToAI figured out the reason: @haiyangToAI is currently checking if we can make a dirty-hack and change this value on our own. |
@danwos EDIT: You realized it already :) |
Yeah, already moved and deleted it :) |
Thanks for finding this out. |
@danwos @haiyangToAI There seems to be an issue at Sphinx for the behavior I mentioned above |
* Fixed sphinx-needs warnings return code * Added check condition and more test scenarios Fix for #344
Usage of
-W
shall handle all warnings as errors and the sphinx-build executable shall return a non-zero value as error code. Also the usage of-w <file>
shall write all warnings to a file.This works incase of Sphinx warnings, but not for warnings created with
needs_warnings
. Because of this pipelines cannot be configured to break incase ofneeds_warnings
.To reproduce the problem, do the following steps
needs_warnings
inconf.py
need_warnings
on the console0
is returned (a non-zero value is expected)error.log
All
needs_warnings
are expected in the log.Could it be that
needs_warnings
is always writing to stdout instead of stderror (even with -W)?The text was updated successfully, but these errors were encountered: