-
Notifications
You must be signed in to change notification settings - Fork 2
/
.golangci.yaml
100 lines (95 loc) · 2.8 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
run:
timeout: 15m
linters:
disable-all: true
enable:
- asciicheck
- bodyclose
- depguard
- dogsled
- durationcheck
- exportloopref
- 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/
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."
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
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
# Previously it was not a thing to use a package name in names of a package entities
- "exported: type name will be used as .*" # revive
max-issues-per-linter: 0
max-same-issues: 0