aws-cloudformation / cfn-lint-visual-studio-code

CloudFormation Linter IDE integration, autocompletion, and documentation
https://marketplace.visualstudio.com/items?itemName=kddejong.vscode-cfn-lint
Apache License 2.0
259 stars 143 forks source link

cfnLint.path doesn't resolve ${workspaceFolder} #27

Open bwilder opened 5 years ago

bwilder commented 5 years ago

Hi, I was having a hard time getting this extension to work until I found https://github.com/awslabs/aws-cfn-lint-visual-studio-code/issues/21.

> Determined this file is a CloudFormation Template. file:///Users/user/test/test.yml. Found the string AWSTemplateFormatVersion
> running............. ${workspaceFolder}/venv/bin/cfn-lint --format,json,--template,/Users/user/test/test.yml
> Unable to start cfn-lint (Error: spawn ${workspaceFolder}/venv/bin/cfn-lint ENOENT). Is cfn-lint installed correctly?

After doing a which cfn-lint, grabbing the results, and making that the value of `cfnLint.Path, things started working.

Determined this file is a CloudFormation Template. file:///Users/user/test/test.yml. Found the string AWSTemplateFormatVersion
running............. /Users/user/test/venv/bin/cfn-lint --format,json,--template,/Users/user/test/test.yml

Looks like ${workspaceFolder} isn't being resolved. Is this the expected behavior?

cmmeyer commented 5 years ago

Hey there, thanks for raising this!

I don't think we currently process VS Code Predefined Variables in our settings, so your resolution is correct. If it's alright with you, I'm going to treat this as an enhancement to add the ability to use VS Code predefined variables (as defined here: https://code.visualstudio.com/docs/editor/variables-reference) when defining linter settings.

bwilder commented 5 years ago

Sure thing, thanks!

kddejong commented 5 years ago

This is the best I can do for now. Looks like this is a common issue when using settings. https://github.com/Microsoft/vscode/issues/2809