-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
81 lines (77 loc) · 2.5 KB
/
.golangci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
# use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.49.x
run:
# golang-ci lint runtime timeout
deadline: 5m
# moias latest supported Go version
go: "1.19"
# see: https://golangci-lint.run/usage/configuration/
modules-download-mode: vendor
# include test files or not.
tests: false
linters:
# Enable specific linter (not part of default linters)
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
enable:
# gofumpt as replacement for gofmt.
- gofumpt
# revive as replacement for golint.
- revive
# whitespace to identify unnecessary whitespaces.
- whitespace
# godot checks if all top-level comments contain a period at the end of the last sentence if needed.
- godot
# depguard to make sure import paths specific are required
- depguard
# gocyclo calculates cyclomatic complexities of functions in Go source code.
- gocyclo
# gosec inspects source code for security problems by scanning the Go AST.
- gosec
# wrapcheck is a Go linter to check that errors from external packages are wrapped
- wrapcheck
# misspell checks for spelling mistakes
- misspell
issues:
# independently of option `exclude` we use default exclude patterns
exclude-use-default: false
# excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test.go
linters:
- errcheck
linters-settings:
# depguard settings
depguard:
list-type: blacklist
include-go-root: true
# error on the following import paths:
packages-with-error-message:
- github.com/stretchr/testify/assert: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
- github.com/pkg/errors: "Use fmt or errors instead of github.com/pkg/errors"
# gofumpt settings
gofumpt:
extra-rules: true
# misspell settings
misspell:
locale: US
# revive settings
revive:
ignore-generated-header: true
severity: warning
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return
- name: unexported-return
severity: warning
disabled: true
# gosec settings
gosec:
excludes:
# exclude random number check
- G404
# allowance of net/http serve function that has no support for setting timeouts
- G114
gocyclo:
min-complexity: 15