AtomLinter / linter-codeclimate

An Atom Linter plugin for the Code Climate CLI
http://github.com/codeclimate/codeclimate
MIT License
10 stars 5 forks source link

Use Dockerized codeclimate #45

Closed chikamichi closed 7 years ago

chikamichi commented 7 years ago

Hi,

Not a real issue, more like a documentation bit. Feel free to incorporate this into the README and/or wiki if that makes sense.

If one follows along codeclimate's latest guidelines about installing the CLI as a docker container, then linter-codeclimate will complain about the executable being not found. The trick into solving is to create such an executable, that will contain the recommended docker command to actually run Code Climate's CLI.

By default, linter-codeclimate expects the binary script to be available at /usr/local/bin/codeclimate. Create one such file with the following content:

#!/bin/sh

docker run \
       --interactive --tty --rm \
       --env CODECLIMATE_CODE="/code" \
       --volume "$PWD":/code \
       --volume /var/run/docker.sock:/var/run/docker.sock \
       --volume /tmp/cc:/tmp/cc \
       codeclimate/codeclimate $@

One may use a user-owned, PATH-reachable file instead, say ~/bin/codeclimate, in which case the exact path must be replicated in Atom's preferences for the linter-codeclimate package.

The script must be made executable: [sudo] chmod +x path/to/codeclimate.