Commit 2e2349b8 authored by Manuel Kieweg's avatar Manuel Kieweg 🤷
Browse files

Merge branch 'strict-linting' into 'master'

strict linter for all merge requests

See merge request cocsn/gosdn!131
parents 78f2ebe8 236fb810
code-quality-master:
image: golangci/golangci-lint:latest-alpine
stage: test
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
# writes golangci-lint output to gl-code-quality-report.json
- golangci-lint run --config build/ci/.golangci-config/.golangci-master.yml --out-format code-climate | tee gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json
paths:
- gl-code-quality-report.json
code-quality:
image: golangci/golangci-lint:latest-alpine
stage: test
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == "develop"
script:
# writes golangci-lint output to gl-code-quality-report.json
- golangci-lint run --config build/ci/.golangci-config/.golangci.yml --out-format code-climate | tee gl-code-quality-report.json
......@@ -27,4 +12,4 @@ code-quality:
reports:
codequality: gl-code-quality-report.json
paths:
- gl-code-quality-report.json
- gl-code-quality-report.json
\ No newline at end of file
run:
timeout: 5m
issues-exit-code: 1
# directories to be ignored by linters
skip-dirs:
- forks
- test
skip-dirs-default: true
skip-files:
- nucleus/http.go
# output settings -> code-climate for GitLab
output:
format: code-climate
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
path-prefix: ""
# custom settings for linters
linters-settings:
gocyclo:
min-complexity: 15
golint:
min-confidence: 0.8
# enable the specific needed linters
linters:
disable-all: true
enable:
- gofmt
- golint
- gocyclo
- govet
issues:
exclude-use-default: false
......@@ -29,3 +29,5 @@ linters:
- golint
- gocyclo
- govet
issues:
exclude-use-default: false
golangci-lint run\
--config .ci/.golangci-master.yml\
--config .ci/.golangci.yml\
--out-format code-climate |\
jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"'
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