Skip to content
Snippets Groups Projects
Commit 332e9297 authored by Malte Bauch's avatar Malte Bauch
Browse files

added support for different linting depending on branch

The main reason for this commit is to provide different lint configurations
e.g. merge requests into master should follow slightly stricter linting rules.
parent 5c11a99c
No related branches found
No related tags found
2 merge requests!23Resolve "CI/CD",!18Develop
Pipeline #52107 failed
File moved
run:
timeout: 5m
issues-exit-code: 1
output:
format: code-climate
print-issued-lines: true
print-linter-name: true
uniq-by-line: true
path-prefix: ""
linters-settings:
gocyclo:
min-complexity: 15
golint:
min-confidence: 0.8
linters:
disable-all: true
enable:
- gofmt
- golint
- gocyclo
- govet
stages:
- test
code-quality-master:
image: golangci/golangci-lint:latest-alpine
tags:
- docker
stage: test
only:
- merge_requests
except:
variables:
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "master"
script:
- git config --global url."https://$GO_MODULES_USER:$GO_MODULES_ACCESS_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
# writes golangci-lint output to gl-code-quality-report.json
- golangci-lint run --config .ci/.golangci-master.yml | tee gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json
code-quality:
image: golangci/golangci-lint:latest-alpine
tags:
......@@ -8,10 +27,13 @@ code-quality:
stage: test
only:
- merge_requests
except:
variables:
- $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"
script:
- git config --global url."https://$GO_MODULES_USER:$GO_MODULES_ACCESS_TOKEN@code.fbi.h-da.de".insteadOf "https://code.fbi.h-da.de"
# writes golangci-lint output to gl-code-quality-report.json
- golangci-lint run | tee gl-code-quality-report.json
- golangci-lint run --config .ci/.golangci.yml | tee gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment