-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Expand file tree
/
Copy path.golangci.yml
More file actions
110 lines (101 loc) · 3.86 KB
/
.golangci.yml
File metadata and controls
110 lines (101 loc) · 3.86 KB
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
105
106
107
108
109
110
version: "2"
run:
go: "1.25"
linters:
enable:
- copyloopvar
- errorlint
- exhaustive
- intrange
- makezero
- nakedret
- nolintlint
- prealloc
- revive
- thelper
- tparallel
- unconvert
- unparam
- wastedassign
settings:
copyloopvar:
check-alias: true
exhaustive:
default-signifies-exhaustive: true
nakedret:
# the gods will judge me but I just don't like naked returns at all
max-func-lines: 0
staticcheck:
checks:
- all
# SA1019 is for checking that we're not using fields marked as
# deprecated in a comment. It decides this in a loose way so I'm
# silencing it. Also because it's tripping on our own structs.
- -SA1019
# ST1003 complains about names like remoteUrl or itemId (should be
# remoteURL and itemID). While I like these suggestions, it also
# complains about enum constants that are all caps, and we use these and
# I like them, and also about camelCase identifiers that contain an
# underscore, which we also use in a few places. Since it can't be
# configured to ignore specific cases, and I don't want to use nolint
# comments in the code, we have to disable it altogether.
- -ST1003 # Poorly chosen identifier
# Probably a good idea, but we first have to review our error reporting
# strategy to be able to use it everywhere.
- -ST1005 # Error strings should not be capitalized
# Many of our classes use self as a receiver name, and we think that's fine.
- -ST1006 # Use of self or this as receiver name
# De Morgan's law suggests to replace `!(a && b)` with `!a || !b`; but
# sometimes I find one more readable than the other, so I want to decide
# that myself.
- -QF1001 # De Morgan's law
# QF1003 is about using a tagged switch instead of an if-else chain. In
# many cases this is a useful suggestion; however, sometimes the change
# is only possible by adding a default case to the switch (when there
# was no `else` block in the original code), in which case I don't find
# it to be an improvement.
- -QF1003 # Could replace with tagged switch
# We need to review our use of embedded fields. I suspect that in some
# cases the fix is not to remove the selector for the embedded field,
# but to turn the embedded field into a named field.
- -QF1008 # Could remove embedded field from selector
# The following checks are all disabled by default in golangci-lint, but
# we disable them again explicitly here to make it easier to keep this
# list in sync with the gopls config in .vscode/settings.json.
- -ST1000, # At least one file in a package should have a package comment
- -ST1020, # The documentation of an exported function should start with the function's name
- -ST1021, # The documentation of an exported type should start with type's name
- -ST1022, # The documentation of an exported variable or constant should start with variable's name
dot-import-whitelist:
- github.com/jesseduffield/lazygit/pkg/integration/components
revive:
severity: warning
rules:
- name: atomic
- name: context-as-argument
- name: context-keys-type
- name: error-naming
- name: var-declaration
- name: package-comments
- name: range
- name: time-naming
- name: indent-error-flow
- name: errorf
- name: superfluous-else
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- vendor/
formatters:
enable:
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- vendor/