diff --git a/.codeclimate.yml b/.codeclimate.yml index 2dffd627f..497f42db8 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -6,10 +6,12 @@ engines: config: languages: - javascript + shellcheck: + enabled: true ratings: paths: - - bin/eslint.js - - lib/*.js + - bin/ + - lib/**/*.js exclude_paths: - "node_modules/**" - "test/**" diff --git a/bin/yarn b/bin/yarn index 459b52afa..94706d676 100755 --- a/bin/yarn +++ b/bin/yarn @@ -2,5 +2,14 @@ set -e -IMAGE_NAME=${IMAGE_NAME:-codeclimate/codeclimate-eslint} -docker run --rm --volume "$PWD:/usr/src/app" "$IMAGE_NAME" sh -c "cd /usr/src/app && yarn $*" +case "$(uname -s)" in + "Darwin") user="root:root" ;; + *) user="$(id -u):$(id -g)" ;; +esac + +docker run \ + --rm \ + --user "$user" \ + --volume "$PWD:/usr/src/app" \ + --workdir "/usr/src/app" \ + codeclimate/codeclimate-eslint yarn "$@"