From 466dced92eaee306ba007e08c9f519e634ea96fc Mon Sep 17 00:00:00 2001 From: Andy Anastasiadis-Gray Date: Tue, 19 Nov 2024 14:03:01 +1300 Subject: [PATCH] fix: remove the warning from docker image output --- lib/codeclimate_diff/codeclimate_wrapper.rb | 4 +++- lib/codeclimate_diff/version.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/codeclimate_diff/codeclimate_wrapper.rb b/lib/codeclimate_diff/codeclimate_wrapper.rb index 458f3ed..02b5cb7 100644 --- a/lib/codeclimate_diff/codeclimate_wrapper.rb +++ b/lib/codeclimate_diff/codeclimate_wrapper.rb @@ -9,7 +9,7 @@ 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 \ @@ -17,6 +17,8 @@ def run_codeclimate(filename = "") --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 diff --git a/lib/codeclimate_diff/version.rb b/lib/codeclimate_diff/version.rb index a5dfa15..6ed8235 100644 --- a/lib/codeclimate_diff/version.rb +++ b/lib/codeclimate_diff/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module CodeclimateDiff - VERSION = "0.1.13" + VERSION = "0.1.14" end