-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
95 lines (93 loc) · 3.62 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
linters:
enable-all: true
disable:
- cyclop # we keep a tab on function length ourselves
- deadcode # deprecated
- depguard # we review our dependencies in pull requests
- dupl # too many false positives
- exhaustivestruct # abandoned
- forbidigo # Git Town prints a lot to the CLI
# - funlen # we keep track of this via code reviews
- gci # we prefer keeping import statements as one blocks without empty lines
# - gocognit # we keep track of this via code reviews
- goconst # tests contain a ton of hard-coded test strings, for example branch names
# - gocyclo # we keep track of this via code reviews
- godox # we allow todo comments
- golint # deprecated
- gomnd # tests contain hard-coded test data that wouldn't make sense to extract into constants
- ifshort # this enforces less readable code
- interfacer # deprecated
- lll # we aren't enforcing a line length at this point
# - maintidx # we keep complexity under check with code reviews
- maligned # deprecated
- musttag # we document JSON serialization via unit tests
- nakedret # not useful
# - nestif # we keep complexity under check with code reviews
- nonamedreturns # they are useful in too many situations
- nlreturn # this forces unnecessary empty lines in function bodies
- nosnakecase # deprecated
- promlinter # not using Prometheus
- protogetter # not using Protobuffs
- scopelint # deprecated
- structcheck # deprecated
- varcheck # deprecated
- varnamelen # not really useful
- wrapcheck # too many false positives for return values defined in internal packages
- wsl # this linter creates too many false positives, our policy is to not have any empty lines in code blocks
linters-settings:
ireturn:
allow:
- error
- stdlib
tagliatelle:
case:
use-field-name: true
rules:
json: pascal # set to pascal to maintain backwards compatibility
issues:
# List of regexps of issue texts to exclude, empty list by default.
# But independently from this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`. To list all
# excluded by default patterns execute `golangci-lint run --help`
exclude:
- Using the variable on range scope `(input|expected)` in function literal
exclude-rules:
- linters:
- goerr113
text: "do not define dynamic errors"
- text: receiver name should be a reflection of its identity
linters:
- stylecheck
- text: receiver name should be a reflection of its identity
linters:
- revive
- text: is missing field undeclaredOpcodeMethods
linters:
- exhaustruct
- text: (cobra.Command|subshell.Options|gitea.*Options|github.*Options|gitlab.*Options|godog.Options) is missing fields?
linters:
- exhaustruct
- linters:
- exhaustruct
text: promptui.(Prompt|PromptTemplates) is missing fields
- linters:
- exhaustruct
text: doc.(GenManHeader) is missing fields
- linters:
- exhaustruct
text: dialog.(TextPromptArgs) is missing fields
- linters:
- predeclared
text: package name print has same name as predeclared identifier
- path: src/internal/git-town/token.go # it's named as token, but is just the key
text: "G101: Potential hardcoded credentials"
linters:
- gosec
- path: src/internal/styles/
linters:
- gochecknoglobals
- path: src/internal/messages/ # easier to read message name
text: (don't|should not) use underscores
linters:
- revive
- stylecheck