Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
danet
goSDN
Commits
2e2349b8
Commit
2e2349b8
authored
Apr 12, 2021
by
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
Changes
4
Hide whitespace changes
Inline
Side-by-side
build/ci/.code-quality-ci.yml
View file @
2e2349b8
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
build/ci/.golangci-config/.golangci-master.yml
deleted
100644 → 0
View file @
78f2ebe8
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
build/ci/.golangci-config/.golangci.yml
View file @
2e2349b8
...
...
@@ -29,3 +29,5 @@ linters:
-
golint
-
gocyclo
-
govet
issues
:
exclude-use-default
:
false
build/ci/.golangci-config/.runlint.sh
View file @
2e2349b8
golangci-lint run
\
--config
.ci/.golangci
-master
.yml
\
--config
.ci/.golangci.yml
\
--out-format
code-climate |
\
jq
-r
'.[] | "\(.location.path):\(.location.lines.begin) \(.description)"'
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment