-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
.golangci.yml
71 lines (67 loc) · 2.05 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
# 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.62.2
run:
# golang-ci lint runtime timeout
deadline: 5m
# latest supported Go version
go: '1.23'
# see: https://golangci-lint.run/usage/configuration/
modules-download-mode: readonly
# 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
# 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:
# 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: 20