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

Errors on yaml.validate: true #97

Closed
riccardopedrielli opened this issue Apr 22, 2020 · 7 comments
Closed

Errors on yaml.validate: true #97

riccardopedrielli opened this issue Apr 22, 2020 · 7 comments

Comments

@riccardopedrielli
Copy link

Environment:

  • macOS
  • cfn-lint: 0.29.5
  • vs code: 1.44.2
  • vscode-cfn-lint: 0.11.1
  • vscode-yaml: 0.7.2
  • no other yaml extension installed

Problem

This extension is setting yaml.validate to false whenever it starts.
As I understand this is done because, with the default setting (true), a lot of false errors are shown.

Leaving out that's a bad practice to edit other extension's settings with no user consent/notice, my first question is:

  • Why disabling the validation instead of fixing the bug?

I noticed other closed issues on this topic, but it seems the problem was never resolved.
Since I think that we should be able to work with the validation enabled, I want to ask:

  • Will there ever be an effort to make this extension work with yaml.validate: true?
@kddejong
Copy link
Contributor

kddejong commented Apr 22, 2020

Let me test a few things out.
Also note that the Readme needs to be updated to include the setting.
https://github.com/aws-cloudformation/aws-cfn-lint-visual-studio-code/blob/befb50db9205316d6940d50cde5d5ffa68486195/package.json#L87-L91
The idea here is to draw visibility to issues with the yaml validation as we are mostly looking to use that extension for the autocomplete capabilities. We tried to wrap the setting with our own setting and only set it if appropriate. I would agree this isn't an ideal solution but we believe the autcomplete functionality is helpful to doing CloudFormation development. What I want to make sure is that we didn't miss a scenario. We should only be setting yaml.validate to false only if you have cfnLint.validateUsingJsonSchema set to false

@riccardopedrielli
Copy link
Author

Another problem of writing yaml.validate: false into the settings.json of vs code is also that the validation is disabled for every other yaml file, be it a cfn o just a regular yaml.

@motdde
Copy link

motdde commented Jul 6, 2022

Hello @kddejong and @PatMyron,

Have you been able to find a solution to this?

I am new to cloud formation. I have spent several hours figuring out why block scalars are flagged as errors in the Yaml files. JSON schema is not identifying values as strings when working with the Intrinsic function.

@kddejong
Copy link
Contributor

I'm working on a new way to include the yaml language server that should resolve these issues. its a bigger rewrite to the plugin but should allow us to completely decouple from the vscode-yaml extension.

@kddejong
Copy link
Contributor

We no longer require vscode-yaml and this should be resolved at this point.

@motdde
Copy link

motdde commented Aug 19, 2022

Thanks @kddejong

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

4 participants