Commit 91192d7d authored by Alessio Caiazza's avatar Alessio Caiazza

Upgrade codeclimate to 0.70.1

Code Climate 0.70.1 changed a lot, now we need `--dev` in order to use
custom engines, they also added two engines: structure and duplication; moreover
they release version 2 of the configuration file.

Those engines are enabled by default and looks like they do not support go code.
parent 35c26369
Pipeline #14153016 passed with stages
in 18 minutes and 9 seconds
---
engines:
version: "2"
plugins:
structure:
enabled: false
duplication:
enabled: false
gofmt:
enabled: true
golint:
......@@ -17,7 +22,7 @@ engines:
enabled: true
config:
over: 9
exclude_paths:
exclude_patterns:
- vendor/
- helpers/shell_escape.go
- executors/kubernetes/executor_kubernetes_test.go
......@@ -29,8 +34,5 @@ engines:
enabled: false
shellcheck:
enabled: false
ratings:
paths:
- "**.go"
exclude_paths:
exclude_patterns:
- vendor/
......@@ -95,10 +95,9 @@ codequality:
CODECLIMATE_FORMAT: json
cache: {}
dependencies: []
before_script:
- apk add -U make
before_script: []
script:
- make codequality > codeclimate.json
- ./scripts/codequality analyze -f json --dev | tee codeclimate.json
artifacts:
paths: [codeclimate.json]
expire_in: 1 week
......
......@@ -5,7 +5,6 @@ REVISION := $(shell git rev-parse --short=8 HEAD || echo unknown)
BRANCH := $(shell git show-ref | grep "$(REVISION)" | grep -v HEAD | awk '{print $$2}' | sed 's|refs/remotes/origin/||' | sed 's|refs/heads/||' | sort | head -n 1)
BUILT := $(shell date +%Y-%m-%dT%H:%M:%S%:z)
TESTFLAGS ?= -cover
CODECLIMATE_FORMAT ?= text
LATEST_STABLE_TAG := $(shell git -c versionsort.prereleaseSuffix="-rc" -c versionsort.prereleaseSuffix="-RC" tag -l "v*.*.*" --sort=-v:refname | awk '!/rc/' | head -n 1)
export IS_LATEST :=
......@@ -81,14 +80,7 @@ deps:
go install cmd/vet
codequality:
@docker pull registry.gitlab.com/nolith/codeclimate-gocyclo > /dev/null
@docker tag registry.gitlab.com/nolith/codeclimate-gocyclo codeclimate/codeclimante-gocyclo > /dev/null
@docker run --rm --tty --env CODECLIMATE_CODE="$(PWD)" \
--volume "$(PWD)":/code \
--volume "$(PWD)/.codeclimate-global.yml":/config.yml \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
codeclimate/codeclimate:0.69.0 analyze -f $(CODECLIMATE_FORMAT)
./scripts/codequality analyze --dev
out/docker/prebuilt-x86_64.tar.xz: $(GO_FILES)
# Create directory
......
#!/bin/sh
set -eo pipefail
code_path=$(pwd)
docker pull registry.gitlab.com/nolith/codeclimate-gocyclo > /dev/null
docker tag registry.gitlab.com/nolith/codeclimate-gocyclo codeclimate/codeclimate-gocyclo > /dev/null
exec docker run --rm --tty --env CODECLIMATE_CODE="$code_path" \
--volume "$code_path":/code \
--volume "$code_path/.codeclimate-global.yml":/config.yml \
--volume /var/run/docker.sock:/var/run/docker.sock \
--volume /tmp/cc:/tmp/cc \
codeclimate/codeclimate:0.70.1 "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment