/
.golangci.yml
99 lines (99 loc) · 4.03 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
run:
timeout: 5m
skip-dirs:
- cached-deps
build-tags:
- k8s
- unit_test
linters:
enable:
- wrapcheck
- nolintlint
- gofmt
- gosimple
- errcheck
- ineffassign
- unused
- asciicheck
- asasalint
- bidichk
- exhaustive
- goprintffuncname
- depguard
# - bodyclose CORE-1317
# - gocritic CORE-1318
# - gosec CORE-1319
linters-settings:
errcheck:
exclude-functions:
- (*database/sql.Tx).Rollback
- (*github.com/spf13/cobra.Command).MarkFlagCustom
- (*github.com/spf13/cobra.Command).Usage
nolintlint:
allow-unused: false
allow-leading-space: false
require-explanation: false
require-specific: true
wrapcheck:
ignoreSigs:
- github.com/pachyderm/pachyderm/v2/src/internal/errors.Errorf
- github.com/pachyderm/pachyderm/v2/src/internal/errors.New
- github.com/pachyderm/pachyderm/v2/src/internal/errors.Unwrap
- github.com/pachyderm/pachyderm/v2/src/internal/errors.EnsureStack
- github.com/pachyderm/pachyderm/v2/src/internal/errors.Join
- github.com/pachyderm/pachyderm/v2/src/internal/errors.JoinInto
- github.com/pachyderm/pachyderm/v2/src/internal/errors.Close
- github.com/pachyderm/pachyderm/v2/src/internal/errors.Invoke
- github.com/pachyderm/pachyderm/v2/src/internal/errors.Invoke1
- google.golang.org/grpc/status.Error
- google.golang.org/grpc/status.Errorf
- "(*google.golang.org/grpc/internal/status.Status).Err"
- google.golang.org/protobuf/types/known/anypb.New
- .Wrap(
- .Wrapf(
- .WithMessage(
- .WithMessagef(
- .WithStack(
ignorePackageGlobs:
# These are packages whose return values don't have to be wrapped, not packages where the
# linter isn't used.
- github.com/pachyderm/pachyderm/v2/src/*
ignoreInterfaceRegexps:
- ^fileset\.
- ^collection\.
- ^track\.
gofmt:
simplify: true
exhaustive:
default-signifies-exhaustive: true
# Right now, we only allow opting into the exhaustive check due to a lot of code that makes
# correct use of non-exhaustive switch statements.
# Annotate your switch statement with //exhaustive:enforce to opt in.
explicit-exhaustive-switch: true
explicit-exhaustive-map: true
depguard:
rules:
main:
files:
- "$all"
- "!**/src/internal/log/*.go"
- "!**/etc/**/*.go"
deny:
- pkg: github.com/sirupsen/logrus
desc: use the internal/log package
- pkg: go.uber.org/multierr
desc: "use the internal/errors package"
- pkg: github.com/hashicorp/go-multierror
desc: "use the internal/errors package"
- pkg: github.com/gogo/protobuf/proto
desc: "wrong proto package; use google.golang.org/protobuf/proto"
- pkg: github.com/gogo/protobuf/types
desc: "wrong proto package; use google.golang.org/protobuf/types/..."
- pkg: github.com/gogo/protobuf/jsonpb
desc: "wrong proto package; use google.golang.org/protobuf/encoding/protojson"
- pkg: github.com/golang/protobuf/proto
desc: "wrong proto package; use google.golang.org/protobuf/proto"
- pkg: github.com/golang/protobuf/ptypes
desc: "wrong proto package; use google.golang.org/protobuf/types/..."
- pkg: github.com/golang/protobuf/jsonpb
desc: "wrong proto package; use google.golang.org/protobuf/encoding/protojson"