megalinter icon indicating copy to clipboard operation
megalinter copied to clipboard

Surfacing warnings during successful runs

Open daniel442li opened this issue 1 year ago • 5 comments

Fixes #1541.

Changed code so that the console shows a new tab called "warnings" which shows a list of warnings. Added the regex to .yaml files for both errors and warnings as a way to display the warnings Even when there are no errors, warnings will now show in the console and be displayed Developers can also add their own regex to each descriptor to count warnings

TODO: Add the warnings to additional reporters

Proposed Changes

  1. New schema additions, regex of warnings and warning count
  2. Warning displayed on the console and other reporters in the future
  3. .yaml file regex as yaml linter can very easily be counted

Readiness Checklist

Run megalinter and there should now be a warning tab. Only .yaml files at the current moment support the counting of warnings. Other files will need additional regex to be written.

Author/Contributor

  • [ ] If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • [ ] Label as breaking if this is a large fundamental change
  • [ ] Label as either automation, bug, documentation, enhancement, infrastructure, or performance

daniel442li avatar Aug 03 '22 18:08 daniel442li

That's a great initiative, I was thinking about it for some time now, thanks for implementing it :) Please could use also update Github & Gitlab reporter classes ? And if possible add warning properties in more descriptors than just yaml :)

nvuillam avatar Aug 03 '22 20:08 nvuillam

Yup sounds good. If you happen to know any of the regex of those other files, that would be great. I'll push another commit in the coming days!

daniel442li avatar Aug 03 '22 20:08 daniel442li

I do not (so many linters ^^) but my pattern is the following:

  • copy-paste the result of a linter in https://regex101.com/
  • try until I find the good regexes :D

I used to store test classes success and error logs and display them in online doc, but since v6 it seems i've lost that... i'll try to find why and fix it ^^

nvuillam avatar Aug 03 '22 21:08 nvuillam

jscpd makes a convenient test repository as it contains test files of many different extensions one could run MegaLinter on to view sample linter output for all linters.

Kurt-von-Laven avatar Aug 03 '22 22:08 Kurt-von-Laven

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

If you think this pull request should stay open, please remove the O: stale 🤖 label or comment on the pull request.

github-actions[bot] avatar Sep 12 '22 01:09 github-actions[bot]

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.

If you think this pull request should stay open, please remove the O: stale 🤖 label or comment on the pull request.

github-actions[bot] avatar Oct 13 '22 01:10 github-actions[bot]