Open jkasten2 opened 5 years ago
any update guys ?
Here is my workaround
I've created file in project folder and make it executable:
touch ./rubocop
chmod +x ./rubocop
Filled rubocop
file with:
#!/bin/sh
docker-compose exec -T SERVICE_NAME_HERE bundle exec rubocop -c .rubocop.yml "$@"
# or you can start container on each lint:
# docker-compose run --no-deps --entrypoint= --rm SERVICE_NAME_HERE bundle exec rubocop -c .rubocop.yml "$@"
Setup vscode-ruby-rubocop plugin setting:
{
"ruby.rubocop.executePath": "./"
}
I thing this way is not good to run linter through docker, this should be possible to do using plugin configuration.
Another option is VS Code Remote - Containers But @artem-russkikh's suggestion still simpler and functional.
Feature Request
Would be great if
ruby
andrubocop
didn't have to be installed on the host machine and instead could be run in docker if workspace is using it.Environment Details
I am running Windows 10 with ruby in a docker container in WSL2 with Ubuntu. Once this issue is solved to run rubocop in a docker container WSL2 shouldn't be a factor but stated for more context just in case.
What I have Tried
Tried setting the "Execute Path" in the setting to
docker-compose exec CONTAINER_NAME_HERE bundle exec
however I just get an "... is not executable" warning.Alternative
I was able to use the Docker Linter VScode extension instead which runs rubocop and fills in the lint errors in to VSCode as expected.