feat(shell): add codeclimate wrapper

There are two wrapper scripts for running codeclimate locally in docker.
This script is adapted from their website. There is also a script that
will output the results in vimgrep format, so they can be easily loaded
into the quickfix list.
This commit is contained in:
Ade Attwood 2023-11-04 08:54:02 +00:00
parent c6a4f619bf
commit 331e2ceaf9
2 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,11 @@
#!/bin/bash
set -e
docker run \
--interactive --rm \
--env CODECLIMATE_CODE="$PWD" \
--env CODECLIMATE_DEBUG="$CODECLIMATE_DEBUG" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
codeclimate/codeclimate $@

View file

@ -0,0 +1,5 @@
#! /bin/bash
codeclimate analyze -f json $@ \
| jq -r '.[] | "\(.location.path):\(.location.lines.begin): \(.description)"' \
| grep -v '^null'