cfn-lint-visual-studio-code
cfn-lint-visual-studio-code copied to clipboard
More intelligent handling of yaml.validateUsingJsonSchema configuration
The cfnLint.validateUsingJsonSchema
setting is disabled by default (false
). If the default is used, either by not defining the setting in the VS Code configuration or explicitly setting it to false
, then on the extension being activated the yaml.validate
setting will be set to false
in the user's VS Code global configuration. This has several problems:
- Setting
yaml.validate
tofalse
will disable validation for all YAML documents, not just those which are CloudFormation templates. This makes thecfnLint.validateUsingJsonSchema
misleading, as it's really enabling/disabling YAML validation globally. - This behaviour makes it effectively impossible to use the extension in a workspace which contains CloudFormation templates to be linted (with validation disabled) alongside other YAML documents for which validation should be enabled.
In addition, if cfnLint.validateUsingJsonSchema
is enabled, the previously configured yaml.validate
setting will not be set to true
. That's broadly the correct behaviour w.r.t. not modifying user settings unexpectedly, but it does mean that the extension effectively "breaks" YAML validation by default, requiring additional steps to enable it again alongside validation for CloudFormation templates.
Agreed. I'm working on a better way to integrate into the YAML Language server that I believe will resolve this.
In the newest version we no longer depend on vscode-yaml
extension. We have instead integrated yaml-language-server
into the service side of this plugin. This should resolve this issue. Please let me know if you are continuing to have issues.
Great work, thanks @kddejong.