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" version: "2"
linters: 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: formatters:
# Enable specific formatter. # Enable specific formatter.
...@@ -22,7 +47,7 @@ issues: ...@@ -22,7 +47,7 @@ issues:
# Set to 0 to disable. # Set to 0 to disable.
# Default: 3 # Default: 3
max-same-issues: 0 max-same-issues: 0
fix: true fix: false
run: run:
timeout: 5m timeout: 5m
...@@ -31,7 +31,7 @@ func main() { ...@@ -31,7 +31,7 @@ func main() {
&bindAddr, &bindAddr,
"bindaddr", "bindaddr",
"127.0.0.1:1337", "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() flag.Parse()
......
...@@ -34,6 +34,6 @@ func (h *HealthServer) Health( ...@@ -34,6 +34,6 @@ func (h *HealthServer) Health(
defer span.End() defer span.End()
return &pb.HealthResponse{ return &pb.HealthResponse{
Message: request.Message, Message: request.GetMessage(),
}, nil }, nil
} }
...@@ -18,6 +18,14 @@ lint: ...@@ -18,6 +18,14 @@ lint:
-v ~/.cache/golangci-lint:/.cache/golangci-lint -e GOLANGCI_LINT_CACHE=/.cache/golangci-lint \ -v ~/.cache/golangci-lint:/.cache/golangci-lint -e GOLANGCI_LINT_CACHE=/.cache/golangci-lint \
golangci/golangci-lint:{{ golangci-lint-version }} golangci-lint run 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: ci-lint:
mkdir -p {{ tools-install-path }} mkdir -p {{ tools-install-path }}
export GOBIN={{ tools-install-path }} export GOBIN={{ tools-install-path }}
......
...@@ -32,7 +32,7 @@ func main() { ...@@ -32,7 +32,7 @@ func main() {
&bindAddr, &bindAddr,
"bindaddr", "bindaddr",
"127.0.0.1:1337", "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( flag.StringVar(
&ctrlAddr, &ctrlAddr,
......
...@@ -25,7 +25,7 @@ func (h *HealthServer) Health( ...@@ -25,7 +25,7 @@ func (h *HealthServer) Health(
defer span.End() defer span.End()
return &pb.HealthKmsResponse{ return &pb.HealthKmsResponse{
Message: request.Message, Message: request.GetMessage(),
}, nil }, nil
} }
......
...@@ -38,7 +38,6 @@ func GetTracer(ctx context.Context, target TraceExportTarget) (*sdktrace.TracerP ...@@ -38,7 +38,6 @@ func GetTracer(ctx context.Context, target TraceExportTarget) (*sdktrace.TracerP
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to create trace exporter: %w", err) return nil, fmt.Errorf("failed to create trace exporter: %w", err)
} }
} }
tp := sdktrace.NewTracerProvider( tp := sdktrace.NewTracerProvider(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment