Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/codeclimate_diff/codeclimate_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ class CodeclimateWrapper
def run_codeclimate(filename = "")
docker_platform = CodeclimateDiff.configuration["docker_platform"] || "linux/amd64"

`docker run \
output = `docker run \
--interactive --tty --rm \
--env CODECLIMATE_CODE="$PWD" \
--volume "$PWD":/code \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
--platform #{docker_platform} \
codeclimate/codeclimate analyze -f json #{filename}`

output.gsub(/.*?(?=\[{)/im, "") # remove everything before the first json object (ie WARNINGS)
end

def pull_latest_image
Expand Down
2 changes: 1 addition & 1 deletion lib/codeclimate_diff/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CodeclimateDiff
VERSION = "0.1.13"
VERSION = "0.1.14"
end
Loading