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

Override display severity for particular output formats #2769

Open
anikitin opened this issue Jan 8, 2025 · 0 comments
Open

Override display severity for particular output formats #2769

anikitin opened this issue Jan 8, 2025 · 0 comments

Comments

@anikitin
Copy link

anikitin commented Jan 8, 2025

We use Spectral in CI job and get benefit of dual output option:

  • HTML report file goes to job artifacts;
  • text output goes to stdout (because many people don't look at job artifacts).

There is an option "--display-only-failures" that works globally for all outputs.
It would be great to be able to override it per output, so that we can only output errors to stdout (to keep the log shorter) and all severities to HTML.

It could be done similarly to overridden "-o" command, e.g. "-D.stylish" that will only affect "stylish" output.

At the moment our workarounds are:

  1. Run spectral two times with different CLI options (undesirable because of increased job duration).
  2. Send stylish output to the file, filter warnings/infos then print it to stdout
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

No branches or pull requests

1 participant