forked from amp-labs/connectors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
68 lines (67 loc) · 2.43 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
run:
timeout: 5m
skip-dirs:
- "playground"
- "test"
output:
format: github-actions
linters:
enable-all: true
disable:
# Disabled because we use inits all over the place
- gochecknoinits
# Abandoned, replaced by unused
- varcheck
# Abandoned, replaced by unused
- structcheck
# Abandoned, replaced by unused
- deadcode
# Author archived it, and suggests to not use it in real-world applications
- interfacer
# Abandoned, replaced by revive
- nosnakecase
# Abandoned, replaced by revive
- golint
# Abandoned, replaced by exhaustruct
- exhaustivestruct
# Deprecated by owner
- ifshort
# Archived by owner, replaced by govet
- maligned
# Deprecated by owner, replaced with exportloopref
- scopelint
# Highly annoying. We'd need to whitelist all packages we import, which is a lot of work and adds very little value.
- depguard
# Annoying and unhelpful. Assumes uninitialized (zero-valued) fields are always a bug, which is plain wrong.
- exhaustruct
# Marks [TODO, FIXME, BUG] comments as errors. We use these, so this is not helpful - unless we decide this is a good policy.
- godox
# We're not doing black-box testing, so enabling this would be counterproductive. We might want to discuss this though, it's a good practice.
- testpackage
# Annoying and not useful. Disabling otherwise we have to have comment everywhere
- wrapcheck
# Buggy, it complains about unused nolint rules, when those nolint rules are actually used (and removing them cause other lint errors)
- nolintlint
# Named returns are helpful if there are multiple return values of the same type, and acts as self-documentation of the function.
- nonamedreturns
linters-settings:
# See https://golangci-lint.run/usage/linters#revive
revive:
rules:
# Use var-naming, but add a special rule to accept "Id" rather than forcing "ID"
- name: var-naming
disabled: false
arguments:
- ["ID", "API"]
# See https://staticcheck.io/docs/configuration/options/#checks
stylecheck:
checks: ["all", "-ST1003"]
varnamelen:
# The longest distance, in source lines, that is being considered a "small scope" where it is ok to use short variable names.
# The default is 5, which is quite strict.
max-distance: 10
issues:
exclude-rules:
- text: "don't use ALL_CAPS in Go names"
linters:
- revive