-
Notifications
You must be signed in to change notification settings - Fork 27
/
.golangci.yaml
112 lines (106 loc) · 3.44 KB
/
.golangci.yaml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
run:
timeout: 15m
linters:
disable-all: true
enable:
- asciicheck
- bodyclose
- copyloopvar
- depguard
- dogsled
- durationcheck
- gci
- gochecknoinits
- gocritic
- gofmt
- gofumpt
- goimports
- goprintffuncname
- gosimple
- govet
- ineffassign
- misspell
- nolintlint
- prealloc
- revive
- sloglint
- staticcheck
- stylecheck
- unconvert
- unused
- whitespace
linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/flant/)
goimports:
local-prefixes: github.com/flant/
# TODO: replace deprecated methods
# ignore deprecated
# https://staticcheck.dev/docs/checks/#SA1019
staticcheck:
checks: ["all","-SA1019"]
sloglint:
# Enforce not mixing key-value pairs and attributes.
no-mixed-args: true
# Enforce using key-value pairs only (overrides no-mixed-args, incompatible with attr-only).
kv-only: false
# Enforce using attributes only (overrides no-mixed-args, incompatible with kv-only).
attr-only: false
# Enforce not using global loggers.
no-global: ""
# Enforce using methods that accept a context.
context: ""
# Enforce using static values for log messages.
static-msg: false
# Enforce using constants instead of raw keys.
no-raw-keys: false
# Enforce a single key naming convention.
key-naming-case: ""
# Enforce not using specific keys.
forbidden-keys:
- level
- msg
- logger
- source
- stacktrace
- time
# Enforce putting arguments on separate lines.
args-on-sep-lines: false
depguard:
rules:
Main:
files:
- $all
deny:
- pkg: "github.com/evanphx/json-patch"
desc: "The 'github.com/evanphx/json-patch' package is superseded. Use pkg/utils/jsonpatch.go instead."
- pkg: "gopkg.in/satori/go.uuid.v1"
desc: "Use https://github.com/gofrs/uuid instead. Satori/go.uuid is no longer maintained and has critical vulnerabilities."
issues:
exclude:
# Using underscores is a common practice, refactor in the future
- "var-naming: don't use an underscore in package name" # revive
- "ST1003: should not use underscores in package names" # stylecheck
# Sometime errors are used to propagate messages for end-users
- "ST1005: error strings should not be capitalized" # stylecheck
- "error-strings: error strings should not be capitalized or end with punctuation or a newline" # revive
- "ST1005: error strings should not end with punctuation or newlines" # stylecheck
# Dot imports are used for types, consider refactoring
- "dot-imports: should not use dot imports" # revive
- "ST1001: should not use dot imports" # stylecheck
# Init functions are used for global variables' initialization, consider refactoring
- "don't use `init` function"
# Suggests changing Json -> JSON. Figure out which style we want to follow.
- "var-naming:" # revive
- "ST1003: " # stylecheck
# Exported name should not start with the package name, e.g., helm3.Helm3Options.
# However, this penetrates all the code and sometimes is used to avoid name collisions.
# Nice to refactor, but not necessary.
- "exported: type name will be used as" # revive
# Do not know why, but a complicated thing to refactor. Let it be for now.
- "unexported-return: exported func NewModuleManager" # revive
max-issues-per-linter: 0
max-same-issues: 0