stoplightio / spectral

A flexible JSON/YAML linter for creating automated style guides, with baked in support for OpenAPI v3.1, v3.0, and v2.0 as well as AsyncAPI v2.x.
https://stoplight.io/spectral
Apache License 2.0
2.37k stars 228 forks source link

Have a status to know when the lint has found any warning #2577

Open jdrcabral opened 6 months ago

jdrcabral commented 6 months ago

User story. Have a status to know when the lint execution has warnings

Is your feature request related to a problem? I have spectral configured in my Gitlab CI, configured following the Continuous Integration documentation for Gitlab. I wanted to when we have warning when executing the linter, to the job on Gitlab to be marked as warning instead of a success. I need a way to capture that output and raise as warning so we can easily check the jobs

I can't change the fail-severity, because it shouldn't make the job in the pipeline fail.

Describe the solution you'd like Maybe a different return status for when it executed with any warnings, also shouldn't be the same for an error

Additional context Here we a list of job status: https://docs.gitlab.com/ee/ci/jobs/#the-order-of-jobs-in-a-pipeline