Skip to content

Replace CodeClimate with golangci-lint

Pedro Pombeiro requested to merge golangci-lint into master

What does this MR do?

Replace Code Climate with golangci-lint. golangci-lint is set up to produce Code Climate-compatible output.

Why was this MR needed?

golangci-lint is faster, more efficient, and doesn't resort to using a Docker container locally.

Are there points in the code the reviewer needs to double check?

Made a test to make sure it worked as expected in CI:

image

I've enabled the same linters as were present in Code Climate (gocyclo, gofmt->goimports, govet, golint), and some additional ones (bodyclose, deadcode, dogsled, errcheck, goconst, gosec, ineffassign, misspell, prealloc, structcheck, typecheck, unconvert, unparam, unused, varcheck, whitespace) that didn't require significant changes to the codebase, but will protect us in the future.

LINT_FLAGS is a variable that is used to specify additional flags to the lint target. CI has different requirements than local runs (e.g. removing color from output, specifying return code in case of errors found, etc.)

What are the relevant issue numbers?

Closes #43 (closed)

Edited by Georgi N. Georgiev

Merge request reports

Loading