I have created this docker image in order to run Rubocop from the Atom IDE.
Follow the following steps in order to get rubocop running in Atom using Docker:
linter and linter-rubocop atom packageslinter-rubocop settings and in 'Additional Arguments' put -c .rubocop.yml/usr/local/bin/rubocop:#!/bin/bash
# Remove invalid arguments send by linter-rubocop
CMD_ARGS=""
for arg in $@
do
# -s stands for --stdin which prevent rubocop from working
[[ "$arg" == "-s" ]] && continue
CMD_ARGS="$CMD_ARGS $arg"
done
docker run --rm -v /home:/home/ --workdir / zedtux/docker-rubocop:0.34.2 $CMD_ARGS
chmod +x /usr/local/bin/rubocopNow, in Atom, open a Ruby file and let the magic happening.
Note: First time you'll run it, it will pull the image from the Internet which could takes some time depending on your Internet connection
Note 2: You can find all the available tags here.
The goal is to not install things on your machine, so how to upgrade rubocop without Ruby installed on your machine ?
$ docker run --rm \
-v `pwd`:/app \
-w /app \
ruby \
sh -c 'gem install bundler && bundle update'
This command will mount your current folder in a ruby container, set the working directory (flag -w) to that folder in the container and finally execute (sh -c) the installation of Bundler and then run the command bundle update.
The Gemfile.lock is updated, you can commit it and build a new image of docker-rubocop.
This repository is a fork of the BBC News specific config for Rubocop. Please have a look at their repository for more information.
Content type
Image
Digest
sha256:72b646196…
Size
267.3 MB
Last updated
almost 9 years ago
docker pull zedtux/docker-rubocop