699d3d6060
Increase golangci timeout Fix installing golangci-lint in ci Remove mage targets replaced by golangci Run golint in ci Add goheader linter Enable & fix more linters Fix lint issues Add mage target to automagically fix issues found by golangci golangci-lint run --fix Add golangci config Add golangci mage target Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/api/pulls/676 Co-Authored-By: konrad <konrad@kola-entertainments.de> Co-Committed-By: konrad <konrad@kola-entertainments.de>
73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
run:
|
|
timeout: 5m
|
|
tests: true
|
|
|
|
linters:
|
|
enable:
|
|
- megacheck
|
|
- govet
|
|
- goconst
|
|
- gocritic
|
|
- gocyclo
|
|
- goerr113
|
|
- goheader
|
|
- gofmt
|
|
- goimports
|
|
- golint
|
|
- misspell
|
|
disable:
|
|
- scopelint # Obsolete, using exportloopref instead
|
|
presets:
|
|
- bugs
|
|
- unused
|
|
fast: false
|
|
|
|
linter-settings:
|
|
nestif:
|
|
min-complexity: 6
|
|
goheader:
|
|
template-path: code-hesader-template.txt
|
|
|
|
issues:
|
|
exclude-rules:
|
|
# Exclude some linters from running on tests files.
|
|
- path: _test\.go
|
|
linters:
|
|
- gocyclo
|
|
- deadcode
|
|
- path: pkg/integrations/*
|
|
linters:
|
|
- gocyclo
|
|
- deadcode
|
|
- varcheck
|
|
- unparam
|
|
- bodyclose
|
|
- path: pkg/integrations/*
|
|
text: "unlambda"
|
|
linters:
|
|
- gocritic
|
|
- path: pkg/modules/background/unsplash/unsplash\.go
|
|
linters:
|
|
- bodyclose
|
|
- path: pkg/migration/*
|
|
linters:
|
|
- exhaustive
|
|
- goconst
|
|
- goerr113
|
|
- path: pkg/models/task_collection_filter\.go
|
|
linters:
|
|
- exhaustive
|
|
- path: pkg/utils/random_string\.go
|
|
text: "G404:" # We don't care about cryptographically secure randomness when we're using that utility function.
|
|
linters:
|
|
- gosec
|
|
- path: pkg/modules/dump/*
|
|
linters:
|
|
- goerr113
|
|
- path: pkg/
|
|
text: "err113: do not define dynamic errors, use wrapped static errors instead:"
|
|
linters:
|
|
- goerr113
|
|
- text: "commentFormatting: put a space between `//` and comment text"
|
|
linters:
|
|
- gocritic
|