forked from chainloop-dev/chainloop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
82 lines (77 loc) · 2.3 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
run:
timeout: 10m
linters:
# Note that there are some linters enabled by default, see golang-ci linters
enable:
- goheader
- dupl
- gofmt
- goimports
- misspell
- nakedret
- revive
- gosec
- asciicheck
- whitespace
- errorlint
- forbidigo
- gocritic
- importas
- prealloc
- stylecheck
- unconvert
- dogsled
- goconst
- copyloopvar
- gocyclo
- goprintffuncname
# Can't enable it for now, it crashes https://github.com/ent/ent/pull/3315
# - unparam
linters-settings:
gosec:
excludes:
# https://github.com/moby/moby/issues/48358
- G115
gofmt:
simplify: true
dupl:
threshold: 400
goheader:
template: |-
Copyright {{copyright-year}} The Chainloop Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
values:
regexp:
copyright-year: 202[3|4]
forbidigo:
forbid:
- ^print.*$
- '^t\.Error.*$(# forbid t.Error in favor of using testify\.)?'
- '^t\.Fatal.*$(# forbid t.Fatal in favor of using testify\.)?'
staticcheck:
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Disable deprecation checks, note that we need to deprecate it because golangci-lint doesn't support
# setting a non-error exit code on info severity (setup below)
# https://github.com/golangci/golangci-lint/issues/1981
checks: ["all", "-SA1019"]
severity:
default-severity: error
# NOTE: this still makes the CLI exit with 1 hence the fact that we disabled the rule above as well
# https://github.com/golangci/golangci-lint/issues/1981
rules:
- linters:
- staticcheck
text: "SA1019:"
severity: info
issues:
exclude-rules:
- path: _test\.go
text: "Potential hardcoded credentials"