melexis / warnings-plugin

Command-line tool for marking builds with too many warnings as failed. A command-line alternative for https://github.com/jenkinsci/warnings-plugin. Useable with plugin-less CI systems like Gitlab-CI and even Travis-CI
Apache License 2.0
7 stars 2 forks source link

Modify DOXYGEN_WARNING_REGEX to support multiline warnings #136

Open lit-af opened 5 months ago

lit-af commented 5 months ago

Should fix: #135

JasperCraeghs commented 5 months ago

I don't see the option "Workflow(s) awaiting approval" to trigger the GitHub Actions. Do you know what's wrong, @Letme ?

https://docs.github.com/en/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks

JasperCraeghs commented 5 months ago

Several unit tests fail. One of them is tests/test_doxygen.py:test_multiline

The input of this test case is:

This1 should not be treated as warning
testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"
This should not be treated as warning2
testfile.c:8: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"

Instead of counting 2 warnings, the DoxygenChecker counts only 1 warning:

testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"
This should not be treated as warning2
testfile.c:8: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"

A multiline warning indents all but its first line, doesn't it? I think that the regex must make use of this to make the distinction between a multiline warning and a singleline warning followed by some gibberish.

lit-af commented 5 months ago

I look into it. You might be onto something with the indents on the multiline warnings.

Can you please tell me how to run the tests locally?

JasperCraeghs commented 5 months ago

You can run the tests with tox in a virtual environment.

tox -e py310 when you have Python 3.10 or tox -e py311 when you have Python 3.11 etc.

Alternatively, use pytest after installing the package in editable mode:

pip3 install --editable .
pytest .
Letme commented 3 months ago

can you update with latest master just to see if the tests run now?

I think it would be good to move this forward a bit.

lit-af commented 3 months ago

Sure. I'll try to find some time next week