vscode-linter icon indicating copy to clipboard operation
vscode-linter copied to clipboard

Yamllint does not work in Windows: Overidding default command feature

Open mflova opened this issue 1 year ago • 0 comments

At first, the debugging console said that the executable could not be found in $PATH after adding it, I was getting the following error:

Error while running "yamllint": spawnSync yamllint ENOENT
yamllint's command took 4ms

I realized that it is not working because for Windows users, the only possible way is through pip (docs). Due to this, executable is not a normal "binary" but a python script. And I guess this is where the plugin struggles. Potential solutions are:

  • Is there a quick fix I can do on my side for it? Right now I am calling yamllint with python3 -m yamllint. While in Ubuntu I did not need the python3 -m part, in Windows I do. I also tried defining an alias but of course it is not working.
  • About the fix in this repository, is there a possibility to call for python3 -m yamllint if calling yamllint throws this error?
  • I have also integrated linters into other IDEs by using these type of plugins. Few of them had the possibility to override the default command to avoid these issues. I think this would be the best option. With this, I could define in my settings.json from VSCode that I do not want to use the yamllint command but python3 -m yamllint. This will also solve potential problems that will arise with other plugins, as it provides with good enough flexibility.

I cannot think about any other possible solutions Thanks!

mflova avatar Jun 17 '23 22:06 mflova