stoplightio / vscode-spectral

VS Code extension bringing the awesome Spectral JSON/YAML linter with OpenAPI/AsyncAPI support

Home Page:https://marketplace.visualstudio.com/items?itemName=stoplight.spectral

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting for `--ignore-unknown-format`.

patrickDouglas opened this issue · comments

Describe the solution you'd like
It would be nice to be able to have a boolean Setting that would allow for --ignore-unknown-format.

Additional context
Once unrecognized-format is "tweakable" in a ruleset via stoplightio/spectral#1124, this Setting should be able to be removed in favor of just using the ruleset approach.

Another suggest idea would be to have the option to pull in our configured Spectral object instead, which would allow the user to configure Spectral as they need, without the need to add new Settings. This would also resolve: #23.

It would be nice to be able to have a boolean Setting that would allow for --ignore-unknown-format.

@patrickDouglas It's highly possible setting this setting to false would actually lead Spectral to keep on yelling at the user for every yaml/json file that do not fit the expected format.

Running Spectral usually puts the user in a "I'm gonna lint those" mood and accept the warnings.

However, while working in VSCode against completely unrelated files (think package.json or .travis.yml for instance), with the extension loaded, and lots of warnings may put him/her in a very different, less accepting mood with regards to Spectral.

Thoughts?

Haha, didn't even think of that and yeah, you wouldn't want that. I guess you'd have to enable it in conjunction with the validatingFiles setting in each WorkSpace in order to get around that. I think it would still be best to handle at the ruleset level, as that would allow you to control it all via the spectral.{yaml,json} file in each workspace, but in the interim, I think using it with validatingFiles would work. Thoughts?

I think it would still be best to handle at the ruleset level, as that would allow you to control it all via the spectral.{yaml,json} file in each workspace

@patrickDouglas I strongly agree with that, but we would need stoplightio/spectral#1124 to land. And its priority isn't quite high at this moment. Would you feel like giving a hand contributing it? I'd be happy to support you during that process.

Meanwhile I'll work on stoplightio/spectral#1021 and stoplightio/spectral#1283 to improve the overall UX.