generated from yandex-praktikum/go-musthave-shortener-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
144 lines (131 loc) · 4.1 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
run:
timeout: 10s
allow-parallel-runners: true
linters:
enable-all: true
disable:
- depguard
- gci
- godox
- gofmt
- gofumpt
- goheader
- goimports
- varnamelen
- exhaustivestruct # deprecated
- nonamedreturns # we're using named returns quite often
- errname # naming is too strict and is not observed in many places
- golint # deprecated
- importas # may be useful later, requires configuration
- interfacer # deprecated
- maligned # deprecated
- misspell # we have IDE speller
- scopelint # obsoleted, replaced by other linters
- govet # invoked by the goland internally
- tagliatelle # it isn't very handy to have such linter in a monorepo with a lot of different coding standards
- nlreturn # there is wsl linter what implements the same checks
- ifshort # deprecated in 1.48
- structcheck # deprecated 1.49
- varcheck # deprecated 1.49
- nosnakecase # deprecated 1.48
- deadcode # deprecated 1.49
- lll # disabled in favor of revive
- funlen # disabled in favor of revive
- gocognit # disabled in favor of revive
- cyclop # disabled in favor of revive
- gocyclo # disabled in favor of revive
- ireturn # weird behaviour in CI env - does not react to nolint
linters-settings:
gomoddirectives:
replace-local: true
gomnd:
settings:
mnd:
ignored-functions: os\.(OpenFile|WriteFile|Chmod),p?flag\..*,strconv\.(Format|Parse).*
gosec:
config:
G306: "0666" # enable to create files with permissions 0666 (before umask) or lesser
forbidigo:
forbid:
- (?i)(^|\.)print(f|ln)?$ #forbidden: print, println, fmt.Print, fmt.Println, fmt.Printf
gomodguard:
allowed:
modules:
[ ]
domains:
[ ]
blocked:
modules:
- github.com/magiconair/properties:
recommendations:
- github.com/stretchr/testify/assert
- github.com/stretchr/testify/require
reason: "Please use the one testing framework for the whole repository."
versions:
[ ]
errcheck:
exclude-functions:
- (*buffer.Buffer).Write # Buffer.Write has always nil error returned
- (*github.com/gin-gonic/gin.Context).Error # used to report context errors and returns err itself
- (*github.com/gin-gonic/gin.Error).SetType
- (*github.com/gin-gonic/gin.Error).SetMeta
wrapcheck:
ignoreSigRegexps:
- OnInitComplete
- OnSetupDone
- ProcessInitComplete
- ProcessSetupDone
- ReadInConfig
exhaustruct:
exclude:
- cobra\.Command
wsl:
force-case-trailing-whitespace: 1
revive:
enable-all-rules: true
confidence: 0.8
rules:
- name: function-length
severity: warning
disabled: false
arguments: [ 50, 0 ]
- name: function-result-limit
severity: warning
disabled: false
arguments: [ 3 ]
- name: cognitive-complexity
severity: warning
disabled: false
arguments: [ 20 ]
- name: cyclomatic
severity: warning
disabled: false
arguments: [ 10 ]
- name: line-length-limit
severity: warning
disabled: false
arguments: [ 110 ]
- name: argument-limit
severity: warning
disabled: false
arguments: [ 6 ]
# disabled rules
- name: max-public-structs # quite annoying rule
disabled: true
- name: banned-characters # we don't have banned chars
disabled: true
- name: file-header # we don't have a file headers
disabled: true
- name: flag-parameter # extremely annoying linter, it is absolutely okay to have boolean args
disabled: true
- name: struct-tag # false-positive on tags implemented by other linters
disabled: true
- name: unhandled-error # dont have proper exclusions list
disabled: true
- name: add-constant # dont have exclusions list
disabled: true
- name: empty-lines # it false-positives on one-liners
disabled: true
issues:
max-issues-per-linter: 0
max-same-issues: 0