Skip to content

Commit 0d3baba

Browse files
allow specifying the docker platform to support different mac processors
1 parent 69b1d86 commit 0d3baba

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.codeclimate_diff.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
main_branch_name: main
2-
threshold_to_run_on_all_files: 10
2+
threshold_to_run_on_all_files: 10
3+
# For ARM based processors, use linux/x86_64
4+
docker_platform: linux/amd64

lib/codeclimate_diff/codeclimate_wrapper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55

66
module CodeclimateDiff
77
class CodeclimateWrapper
8+
89
def run_codeclimate(filename = "")
10+
docker_platform = CodeclimateDiff.configuration["docker_platform"] || "linux/amd64"
11+
912
`docker run \
1013
--interactive --tty --rm \
1114
--env CODECLIMATE_CODE="$PWD" \
1215
--volume "$PWD":/code \
1316
--volume /var/run/docker.sock:/var/run/docker.sock \
1417
--volume /tmp/cc:/tmp/cc \
18+
--platform #{docker_platform} \
1519
codeclimate/codeclimate analyze -f json #{filename}`
1620
end
1721

0 commit comments

Comments
 (0)