Skip to content
Snippets Groups Projects
Commit 9f747387 authored by Lyuben Penkovski's avatar Lyuben Penkovski
Browse files

chore: fix linters configuration in ci/cd pipelines

parent da04d54b
No related branches found
No related tags found
1 merge request!11Refactor deployment
Pipeline #71762 passed
...@@ -12,7 +12,7 @@ stages: ...@@ -12,7 +12,7 @@ stages:
- build - build
- trigger-deploy - trigger-deploy
lint: lint:
image: golangci/golangci-lint:v1.50.1 image: golangci/golangci-lint:latest
stage: test stage: test
tags: tags:
- amd64-docker - amd64-docker
...@@ -20,8 +20,8 @@ lint: ...@@ -20,8 +20,8 @@ lint:
- golangci-lint --version - golangci-lint --version
- golangci-lint run - golangci-lint run
before_script: before_script:
- ln -s /builds /go/src/gitlab.com - ln -s /builds /go/src/code.vereign.com
- cd /go/src/gitlab.com/${CI_PROJECT_PATH} - cd /go/src/code.vereign.com/${CI_PROJECT_PATH}
unit tests: unit tests:
image: golang:${GO_VERSION} image: golang:${GO_VERSION}
...@@ -38,8 +38,8 @@ govulncheck: ...@@ -38,8 +38,8 @@ govulncheck:
tags: tags:
- amd64-docker - amd64-docker
before_script: before_script:
- ln -s /builds /go/src/gitlab.com - ln -s /builds /go/src/code.vereign.com
- cd /go/src/gitlab.com/${CI_PROJECT_PATH} - cd /go/src/code.vereign.com/${CI_PROJECT_PATH}
script: script:
- go version - go version
- go install golang.org/x/vuln/cmd/govulncheck@latest - go install golang.org/x/vuln/cmd/govulncheck@latest
......
run: run:
deadline: 5m timeout: 5m
skip-dirs:
issues:
exclude-dirs:
- vendor/ - vendor/
- .*fakes/ - .*fakes/
- .*generated/ - .*generated/
skip-files: exclude-files:
- .*generated.go - .*generated.go
linters: linters:
disable-all: true disable-all: true
enable: enable:
- megacheck
- govet - govet
- errcheck - errcheck
- goconst - goconst
...@@ -20,10 +21,8 @@ linters: ...@@ -20,10 +21,8 @@ linters:
- gosec - gosec
- ineffassign - ineffassign
- nakedret - nakedret
- staticcheck
- unconvert - unconvert
- vet
- vetshadow
- misspell - misspell
- staticcheck - staticcheck
- unused - unused
- gosimple
...@@ -163,6 +163,7 @@ func createLogger(logLevel string, opts ...zap.Option) (*zap.Logger, error) { ...@@ -163,6 +163,7 @@ func createLogger(logLevel string, opts ...zap.Option) (*zap.Logger, error) {
return config.Build(opts...) return config.Build(opts...)
} }
//nolint:misspell
func errFormatter(ctx context.Context, e error) goahttp.Statuser { func errFormatter(ctx context.Context, e error) goahttp.Statuser {
return service.NewErrorResponse(ctx, e) return service.NewErrorResponse(ctx, e)
} }
......
FROM golang:1.21.5-alpine3.17 as builder FROM golang:1.22.4-alpine3.19 as builder
RUN apk add git RUN apk add git
...@@ -11,7 +11,7 @@ ADD . . ...@@ -11,7 +11,7 @@ ADD . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.Version=$APP_VER" -mod=vendor -o /tmp/cache ./cmd/cache/... RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-X main.Version=$APP_VER" -mod=vendor -o /tmp/cache ./cmd/cache/...
FROM alpine:3.17 as runner FROM alpine:3.19 as runner
COPY --from=builder /tmp/cache /opt/cache COPY --from=builder /tmp/cache /opt/cache
......
FROM golang:1.21.5 FROM golang:1.22.4
RUN go install github.com/ysmood/kit/cmd/guard@v0.25.11 RUN go install github.com/ysmood/kit/cmd/guard@v0.25.11
......
//nolint:revive
package cache_test package cache_test
import ( import (
......
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"gitlab.eclipse.org/eclipse/xfsc/tsa/golib/errors" "gitlab.eclipse.org/eclipse/xfsc/tsa/golib/errors"
) )
//nolint:misspell
func NewErrorResponse(ctx context.Context, err error) goahttp.Statuser { func NewErrorResponse(ctx context.Context, err error) goahttp.Statuser {
if err == nil { if err == nil {
return nil return nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment