This package provides the following services:
docker-linter-rubocop
This linter plugin for Linter provides an interface to rubocop on docker. It will be used with files that have the “Ruby” syntax.
You must run a container installed rubocop
via docker-compose
because docker-linter-rubocop use docker exec
to run rubocop
.
Installation
Linter package must be installed on your docker container in order to use this plugin. If Linter is not installed, please follow the instruction.
docker-compose
installation
Follow https://docs.docker.com/engine/installation/.
rubocop
installation
Before using this plugin, you must ensure that rubocop
on your docker container.
$ cd /path/to/your/project
$ touch docker-compose.yml
$ # edit your docker-compose.yml to run ruby
$ docker-compose run ruby bundle init
$ # add `gem 'rubocop'` to your Gemfile
$ docker-compose run ruby bundle init
$ docker-compose run ruby 'sh -c "trap : TERM INT; sleep infinity & wait"' # run your container forever because this package will use `docker exec` to run `rubocop`
Plugin installation
apm install docker-linter-rubocop
TODO
- Cache container name
- Fallback to
docker run
if there are no running container - Better error messages
- docker not found
- docker-compose not found
- docker-compose.yml not found
- rubocop not found
- Running container not found
Contributing
If you would like to contribute enhancements or fixes, please do the following:
- Fork the plugin repository.
- Hack on a separate topic branch created from the latest
master
. - Commit and push the topic branch.
- Make a pull request.
- Welcome to the club!
Please note that modifications should follow these coding guidelines:
- Indent is 2 spaces.
- Code should pass the
coffeelint
linter. - Vertical whitespace helps readability, don’t be afraid to use it.
Thank you for helping out!
Special Thanks
This package is started as fork off https://github.com/AtomLinter/linter-rubocop.