-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.golangci.yaml
106 lines (100 loc) · 2.79 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
run:
timeout: 3m
allow-parallel-runners: true
go: '1.21'
linters:
enable:
# defaults:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
# added:
- bodyclose
- contextcheck
- dupl
- errname
- gocheckcompilerdirectives
- gocritic # MAYBE NOT THIS ONE
- godot
- goimports
- goprintffuncname
- gosec
- importas
- misspell
- noctx
- prealloc
- revive
- tparallel
- unconvert
- unparam
- wastedassign
# currently broken:
# - musttag
linters-settings:
govet:
disable:
- loopclosure # we use GOEXPERIMENT := "loopvar"
goimports:
local-prefixes: github.com/drshriveer/gtools
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
# ifElseChain forces a switch statement for any if/else block > 2 conditions dumb.
# Do what you want when you want.
- ifElseChain
# paramTypeCombine requires
# func(thing, thing string) over func(thing string, thing string)
# I don't care.
- paramTypeCombine
# filepathJoin wants path.Join(prefix,node,node)
# instead of path.Join(prefix, "node/node")
# I don't care..
- filepathJoin
# hugeParam is actually pretty interesting-
# it detects objects that are large and better to pass by
# pointer. I like this in theory, but it is noisy.
- hugeParam
# .. do we really have to name them all?
- unnamedResult
gosec:
excludes:
# G601 Implicit memory aliasing in for loop. should not be valid with loopvar experiment...
- G601
nakedret:
# No naked returns, ever.
max-func-lines: 1 # Default: 30
issues:
include:
- EXC0012 # I prefer to force comments.
- EXC0014 # I prefer to force comments.
exclude-rules:
# Ignore use of weak random number generators in tests
- path: _test\.go
text: "G404:"
linters:
- gosec
# go:generate directives must be on one line; no long-line linting here.
- linters:
- lll
source: "^//go:generate "
# I don't want to disable all of var-naming in revive, but I do want to permit
# the use of ctx_ as a var name for specific use cases.
- linters:
- revive
text: "var-naming: don't use leading k in Go names|var-naming: don't use underscores in Go names; method parameter ctx_ should be ctx|var-naming: don't use underscores in Go names; var err_ should be err"
# embedded generated 'unimplentedXXXServer's can be unused at times.
- linters:
- unused
source: "^\\s*unimplemented\\w*Server"
# gsort handles duplicate tags
- linters:
- staticcheck
text: "SA5008: duplicate struct tag \"gsort\""