Skip to content
Snippets Groups Projects
Commit 56c0b3b1 authored by Neil-Jocelyn Schark's avatar Neil-Jocelyn Schark
Browse files

Resolve "Define better linting rules"

parent c2712e70
No related branches found
No related tags found
1 merge request!16Resolve "Define better linting rules"
Pipeline #269021 passed
version: "2"
linters:
default: standard
enable:
# Default linters
- errcheck
- ineffassign
- staticcheck
- unused
# Manually added linters
- gocyclo
- godot
- gosec
- loggercheck
- misspell
- nestif
- paralleltest
- protogetter
- testifylint
- whitespace
- durationcheck
- bodyclose
- reassign
- lll
- spancheck
- nlreturn
- tparallel
- sqlclosecheck
#- exhaustruct # Does not work with gRPC, as it wants us to implement 'UnimplementedHealthCtrlServer', which is obviously not intended to be implemented. Would otherwise be useful.
formatters:
# Enable specific formatter.
......@@ -22,7 +47,7 @@ issues:
# Set to 0 to disable.
# Default: 3
max-same-issues: 0
fix: true
fix: false
run:
timeout: 5m
......@@ -31,7 +31,7 @@ func main() {
&bindAddr,
"bindaddr",
"127.0.0.1:1337",
"default adress and port to bind the controller interface to",
"default address and port to bind the controller interface to",
)
flag.Parse()
......
......@@ -34,6 +34,6 @@ func (h *HealthServer) Health(
defer span.End()
return &pb.HealthResponse{
Message: request.Message,
Message: request.GetMessage(),
}, nil
}
......@@ -18,6 +18,14 @@ lint:
-v ~/.cache/golangci-lint:/.cache/golangci-lint -e GOLANGCI_LINT_CACHE=/.cache/golangci-lint \
golangci/golangci-lint:{{ golangci-lint-version }} golangci-lint run
lint-fix:
docker run --rm -t -v $(pwd):/app -w /app \
--user $(id -u):$(id -g) \
-v $(go env GOCACHE):/.cache/go-build -e GOCACHE=/.cache/go-build \
-v $(go env GOMODCACHE):/.cache/mod -e GOMODCACHE=/.cache/mod \
-v ~/.cache/golangci-lint:/.cache/golangci-lint -e GOLANGCI_LINT_CACHE=/.cache/golangci-lint \
golangci/golangci-lint:{{ golangci-lint-version }} golangci-lint run --fix
ci-lint:
mkdir -p {{ tools-install-path }}
export GOBIN={{ tools-install-path }}
......
......@@ -32,7 +32,7 @@ func main() {
&bindAddr,
"bindaddr",
"127.0.0.1:1337",
"default adress and port to bind the controller interface to",
"default address and port to bind the controller interface to",
)
flag.StringVar(
&ctrlAddr,
......
......@@ -25,7 +25,7 @@ func (h *HealthServer) Health(
defer span.End()
return &pb.HealthKmsResponse{
Message: request.Message,
Message: request.GetMessage(),
}, nil
}
......
......@@ -38,7 +38,6 @@ func GetTracer(ctx context.Context, target TraceExportTarget) (*sdktrace.TracerP
if err != nil {
return nil, fmt.Errorf("failed to create trace exporter: %w", err)
}
}
tp := sdktrace.NewTracerProvider(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment