/
.golangci.yml
104 lines (101 loc) · 3.94 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
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
- exhaustruct # we call this separately from golangci-lint via "make lint-smoke"
- 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
- godot # comments don't really need to read like prose, we don't use the godoc web UI
- 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
- maligned # deprecated
- maintidx # we keep complexity under check with code reviews
- 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
- nosnakecase # deprecated
- nlreturn # this forces unnecessary empty lines in function bodies
- scopelint # deprecated
- structcheck # deprecated
- typecheck # seems buggy
- 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
- github.com/git-town/git-town/v14/src/git.FrontendRunner
- github.com/git-town/git-town/v14/src/git.BackendRunner
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:
- gocritic
text: "appendAssign: append result not assigned to the same slice" # there are legitimate use cases for this, correct appending should be verified by unit tests
- linters:
- revive
text: "dot-imports: should not use dot imports"
- linters:
- stylecheck
text: "ST1001: should not use dot imports"
- linters:
- goerr113
text: "do not define dynamic errors"
- linters:
- ireturn
text: github.com/git-town/git-town/v14/src/(hosting/hostingdomain.Connector|hosting.Connector)
- path: src/gohacks/cache/cache.go
linters:
- ireturn
- path: src/gohacks/cache/with_previous.go
linters:
- ireturn
- path: src/gohacks/slice/first_element_or.go
linters:
- ireturn
- 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: increment-decrement
linters:
- revive
- linters:
- predeclared
text: package name print has same name as predeclared identifier
- path: src/cli/dialog/git.*_token.go
text: Potential hardcoded credentials
linters:
- gosec
- path: src/messages/en.go
text: Potential hardcoded credentials
linters:
- gosec