Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!131strict linter for all merge requests
Pipeline #67847 passed with warnings
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: code-quality:
image: golangci/golangci-lint:latest-alpine image: golangci/golangci-lint:latest-alpine
stage: test stage: test
allow_failure: true
rules: 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: script:
# writes golangci-lint output to gl-code-quality-report.json # 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 - 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: ...@@ -27,4 +12,4 @@ code-quality:
reports: reports:
codequality: gl-code-quality-report.json codequality: gl-code-quality-report.json
paths: 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: ...@@ -29,3 +29,5 @@ linters:
- golint - golint
- gocyclo - gocyclo
- govet - govet
issues:
exclude-use-default: false
golangci-lint run\ golangci-lint run\
--config .ci/.golangci-master.yml\ --config .ci/.golangci.yml\
--out-format code-climate |\ --out-format code-climate |\
jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"' jq -r '.[] | "\(.location.path):\(.location.lines.begin) \(.description)"'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment