Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the warning from docker image output #10

Merged
merged 1 commit into from
Nov 19, 2024
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