Skip to content

Instantly share code, notes, and snippets.

@Maroo-b
Created November 1, 2024 06:12
Show Gist options
  • Save Maroo-b/10a0417a0a9b9c8dfa25f0da9704f12b to your computer and use it in GitHub Desktop.
Save Maroo-b/10a0417a0a9b9c8dfa25f0da9704f12b to your computer and use it in GitHub Desktop.
Running Rubocop lint through Docker for VSCode
1. Add a script named rubocop to the local root project:
```
#!/bin/sh
docker-compose exec -T docker_service_name bundle exec rubocop -c .rubocop.yml "$@"
```
2. In VsCode settings add the following:
```
"[ruby]": {
"editor.defaultFormatter": "rubocop.vscode-rubocop"
},
"ruby.rubocop.executePath": "./",
```
3. Linting should work on save as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment