Skip to content
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

Surfacing warnings during successful runs #4556

Merged
merged 20 commits into from
Feb 17, 2025
Merged

Surfacing warnings during successful runs #4556

merged 20 commits into from
Feb 17, 2025

Conversation

bdovaz
Copy link
Collaborator

@bdovaz bdovaz commented Jan 21, 2025

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

Fixes #4476

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

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • 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

Sorry, something went wrong.

Daniel Li and others added 3 commits August 12, 2022 12:37

Verified

This commit was signed with the committer’s verified signature.
raimund-schluessler Raimund Schlüßler
wip
wip
Copy link
Contributor

github-actions bot commented Jan 21, 2025

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ API spectral 1 0 0 1.7s
⚠️ BASH bash-exec 6 1 0 0.05s
✅ BASH shellcheck 6 0 0 0.25s
✅ BASH shfmt 6 0 0 0 0.89s
✅ COPYPASTE jscpd yes no no 2.88s
✅ DOCKERFILE hadolint 129 0 0 33.68s
✅ JSON jsonlint 20 0 0 0.2s
✅ JSON v8r 22 0 0 14.31s
⚠️ MARKDOWN markdownlint 267 0 302 0 23.17s
✅ MARKDOWN markdown-table-formatter 267 0 0 0 169.26s
⚠️ PYTHON bandit 215 66 0 3.12s
✅ PYTHON black 215 0 0 0 5.51s
✅ PYTHON flake8 215 0 0 2.06s
✅ PYTHON isort 215 0 0 0 1.32s
✅ PYTHON mypy 215 0 0 11.59s
✅ PYTHON pylint 215 0 0 34.8s
✅ PYTHON ruff 215 0 0 0 0.64s
✅ REPOSITORY checkov yes no no 39.07s
✅ REPOSITORY git_diff yes no no 0.79s
⚠️ REPOSITORY grype yes 31 no 14.6s
✅ REPOSITORY secretlint yes no no 12.31s
✅ REPOSITORY trivy yes no no 15.74s
✅ REPOSITORY trivy-sbom yes no no 0.75s
⚠️ REPOSITORY trufflehog yes 1 no 55.51s
✅ SPELL cspell 718 0 0 12.55s
⚠️ SPELL lychee 349 28 0 6.6s
✅ XML xmllint 3 0 0 0 0.9s
✅ YAML prettier 160 0 0 0 4.62s
✅ YAML v8r 102 0 0 31.03s
✅ YAML yamllint 161 0 0 3.45s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

wip
wip
wip
wip
wip
@bdovaz
Copy link
Collaborator Author

bdovaz commented Feb 16, 2025

Ready for review!

I see this PR as a great achievement for “warning as error” fans like me.

cc @nvuillam @echoix

@echoix
Copy link
Collaborator

echoix commented Feb 17, 2025

I didn't go into too much detail , but I assume that this handles the cases when errors as warnings is used (because I saw that you use the yellow triangle, but it was already used)

@bdovaz bdovaz merged commit 2a9fa16 into main Feb 17, 2025
130 checks passed
@bdovaz bdovaz deleted the add-warnings branch February 17, 2025 22:27
@nvuillam
Copy link
Member

Looks like a quality PR :)

Maybe also handle the retrieve of warnings when output is SARIF ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow linters to report warnings
3 participants