vscode-linter
vscode-linter copied to clipboard
Yamllint does not work in Windows: Overidding default command feature
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
withpython3 -m yamllint
. While inUbuntu
I did not need thepython3 -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 callingyamllint
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 theyamllint
command butpython3 -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!