-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
150 lines (131 loc) · 3.16 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
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
145
146
147
148
149
150
# Copyright (c) 2020-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the LICENSE file.
# Configuration for golangci-lint.
# See https://golangci-lint.run/usage/configuration for more details.
issues:
exclude-rules:
# Prevent issues on `go generate` command directive lines.
- linters:
- lll
source: "^//go:generate "
# Allow URLs with any length.
- linters:
- lll
source: (https?):\/\/[^\s\/$.?#].[^\s]*
# Exclude some linters from running on test files.
- path: _test\.go
linters:
- gocyclo
- gosec
max-issues-per-linter: 0
max-same-issues: 0
linters:
disable-all: true
enable:
- bodyclose
- deadcode
- depguard
- dogsled
- dupl
- errcheck
- exhaustive
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- gofumpt
- goheader
- goimports
- golint
- gomnd
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- lll
- misspell
- nakedret
- noctx
- nolintlint
- scopelint
- staticcheck
- structcheck
- stylecheck
- tparallel
- typecheck
- unconvert
- unparam
- unused
- varcheck
- whitespace
- wrapcheck
# Run all linters, not only fast ones.
fast: false
# Configurations for enabled linters.
# See https://golangci-lint.run/usage/linters for more details.
linters-settings:
depguard:
list-type: blacklist
# Do not check against the standard library.
include-go-root: false
packages:
- golang.org/x/net/context
packages-with-error-message:
- golang.org/x/net/context: "As of Go 1.7 this package is available in the standard library under the name context: golang.org/pkg/context"
dupl:
# Minimum count of tokens before triggering as duplicate code.
threshold: 100
errcheck:
# Report about not checking of errors in type assertions.
# Example: `a := b.(CustomStruct)`
check-type-assertions: true
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- performance
- style
gofumpt:
extra-rules: true
goheader:
values:
const:
AUTHOR: Sven Greb
YEAR: 2020-present
regexp:
EMAIL: .*@svengreb\.de
template: |-
Copyright (c) {{ YEAR }} {{ AUTHOR }} <{{ EMAIL }}>
This source code is licensed under the MIT license found in the LICENSE file.
goimports:
# A comma-separated list of prefixes for local package imports to be put after 3rd-party packages.
local-prefixes: github.com/svengreb/tmpl-go
golint:
min-confidence: 0.0
gomnd:
settings:
mnd:
# The list of enabled checks.
# See ttps://github.com/tommy-muehle/go-mnd/#checks for more details.
checks: argument,assign,case,condition,operation,return
govet:
check-shadowing: true
lll:
line-length: 160
misspell:
locale: US
ignore-words:
- tmpl
- tmpl-go
- tmplgo
# Options for analysis runs.
run:
deadline: 15m
service:
golangci-lint-version: 1.32.x