Created
November 1, 2024 06:12
-
-
Save Maroo-b/10a0417a0a9b9c8dfa25f0da9704f12b to your computer and use it in GitHub Desktop.
Running Rubocop lint through Docker for VSCode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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