-
Notifications
You must be signed in to change notification settings - Fork 39
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
Adds support to fail on warnings #7
base: master
Are you sure you want to change the base?
Adds support to fail on warnings #7
Conversation
If fail-on-warnings is set to 'TRUE' and doxygen produces warnings, this step will fail. Default is 'FALSE'
Hey @SteffenSeckler, sorry that I haven't got around to this yet - been awfully busy at work and totally forgot about this. I'll try to review it sometime this week. |
4f7a5e5
to
3063fbb
Compare
e8aa764
to
a230029
Compare
@SteffenSeckler Ok, finally got around to looking at this PR. I've pushed some changes to your branch with some changes to config. I've noticed an issue when testing on my repo here: mattnotmitt/DelaunayTriangulation (note: seriously recommend nektos/act for testing). It seems that the filter can't handle the relatively common multiline warnings as seen in this build. Have you got any thoughts on how this could be fixed? Apart from that, love the solution 👍 |
|
||
# if $5 is non-empty, apply filter. | ||
if [ ! -z "$5" ]; then | ||
grep "$5" warnings.txt > filtered-out-warnings.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you look into a way in which we can filter out multiline warnings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I interpret the doxygen documentation correctly, there shouldn't really be multiline warnings.
And I assume that in multiple stages of the script... (e.g., using wc -l
for the amount of warnings...).
Possibly, one could filter out that message, or, alternatively, remove the newline before such a message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use WARN_LOGFILE as a command line option and then filter from that file? I've looked at doxygen's source and all warnings are prefixed with warning:
so we can split based on that and then filter the resulting strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Using
WARN_LOGFILE
: Possible, but I assume it's the same result as using2> warnings.txt
. - I also thought about using
warning:
. If someone provides a custom WARN_FORMAT, everything fails, anyways :) But using the default, It should work fine. One would lose the information from the next lines, though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use sed to pull the option out of the doxyfile like we do with the LaTeX option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There can be multi line warnings in doxygen like:
cakephp-4.2.8/src/Collection/Iterator/FilterIterator.php:67: warning: no uniquely matching class member found for
Cake\Collection\Iterator\FilterIterator::unwrap()
or
mesa-21.1.5/src/gallium/frontends/clover/core/program.cpp:28: warning: no uniquely matching class member found for
program::program(clover::context &ctx, std::string &&source, clover::program::il_type il_type)
Possible candidates:
'clover::program::program(clover::context &ctx, std::string &&il, enum il_type il_type)' at line 43 of file mesa-21.1.5/src/gallium/frontends/clover/core/program.hpp
'clover::program::program(clover::context &ctx, const ref_vector< device > &devs={}, const std::vector< module > &binaries={})' at line 46 of file mesa-21.1.5/src/gallium/frontends/clover/core/program.hpp
'clover::program::program(const program &prog)=delete' at line 50 of file mesa-21.1.5/src/gallium/frontends/clover/core/program.hpp
but there are more (some have even a return in them as in the input part there is a return).
Note that there is also the setting WARN_FORMAT
it it is possible to insert. In the past I used:
WARN_FORMAT = "#DOXY1#$file#DOXY2#$line#DOXY3#$text#DOXY4#"
so I could filter with awk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be aware of the fact that in the newer versions of doxygen (as of 1.9.0) there is the possibility FAIL_ON_WARNINGS
with the setting WARN_AS_ERROR
.:
WARN_AS_ERROR
If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when a warning
is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS then doxygen will continue
running as if WARN_AS_ERROR tag is set to NO, but at the end of the doxygen process doxygen will return
with a non-zero status.
Possible values are: NO, YES and FAIL_ON_WARNINGS.
The default value is: NO.
How about we try to use https://pypi.org/project/mlx.warnings/ where we can set number of allowed warnings and only fail if it is outside of the range? |
You can also set Doxygen to fail on warnings in your Doxyfile: https://www.doxygen.nl/manual/config.html Set the WARN_AS_ERROR flag to YES, NO, or FAIL_ON_WARNINGS |
Adds support to fail on warnings.
These warnings can be filtered by a regex using grep.
Filtered and remaining warnings will be printed and the step will be set as failing iff no un-filtered warnings remain.
This adds the options
The old behavior is kept and failure on warnings is only enabled if fail-on-warnings is set to true.