stoplightio / vscode-spectral

VS Code extension bringing the awesome Spectral JSON/YAML linter with OpenAPI/AsyncAPI support
https://marketplace.visualstudio.com/items?itemName=stoplight.spectral
Apache License 2.0
72 stars 23 forks source link

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

Open patrickDouglas opened 4 years ago

patrickDouglas commented 4 years ago

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 https://github.com/stoplightio/spectral/issues/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: https://github.com/stoplightio/vscode-spectral/issues/23.

nulltoken commented 4 years ago

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?

patrickDouglas commented 4 years ago

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?

philsturgeon commented 4 years ago

I’m expecting this feature to help: https://github.com/stoplightio/spectral/issues/1021

If we can tell spectral specifics about what files are what formats then this will all be less of an issue.

nulltoken commented 4 years ago

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 https://github.com/stoplightio/spectral/issues/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 https://github.com/stoplightio/spectral/issues/1021 and https://github.com/stoplightio/spectral/issues/1283 to improve the overall UX.