-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.golangci.yml
68 lines (65 loc) · 3.66 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
# We've chosen to take the approach of enabling all linters, and then disable the redundant ones.
# By this approach we were able to configure the linter exectly to our needs,
# without leaving any good linter behind.
# Also, by this approach we can catch new upcoming linters,
# and disable them if they will turn out to be unnecessary.
run:
skip-dirs:
- ./ent
- ./graphql
linters:
enable-all: true
# https://golangci-lint.run/usage/linters/#disabled-by-default
disable:
- contextcheck # check the function whether use a non-inherited context.
- wrapcheck # Checks that errors returned from external packages are wrapped.
- varnamelen # checks that the length of a variable's name matches its scope.
- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test.
- interfacer # The repository of the linter has been archived by the owner.
- exhaustivestruct # The owner seems to have abandoned the linter. Replaced by exhaustruct.
- exhaustruct # Checks if all structure fields are initialized.
- funlen # Tool for detection of long functions.
- lll # Reports long lines.
- dupl # Tool for code clone detection.
- golint # The repository of the linter has been archived by the owner. Replaced by revive.
- maligned # The repository of the linter has been archived by the owner. Replaced by govet 'fieldalignment'.
- nosnakecase # The repository of the linter has been deprecated by the owner. Replaced by revive(var-naming).
- scopelint # The repository of the linter has been deprecated by the owner. Replaced by exportloopref.
- structcheck # The owner seems to have abandoned the linter. Replaced by unused.
- varcheck # The owner seems to have abandoned the . Replaced by unused.
- testpackage # linter that makes you use a separate _test package.
- nilnil # Checks that there is no simultaneous return of nil error and an invalid value.
- forcetypeassert # finds forced type assertions.
- maintidx # maintidx measures the maintainability index of each function.
- goerr113 # Golang linter to check the errors handling expressions.
- gochecknoglobals # check that no global variables exist.
- ireturn # Accept Interfaces, Return Concrete Types.
- gomnd # An analyzer to detect magic numbers.
- errorlint # finds code that will cause problems with the error wrapping scheme introduced in Go 1.13.
- cyclop # Computes and checks the cyclomatic complexity of functions.
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
- gci # controls golang package import order and makes it always deterministic.
- godox # Tool for detection of FIXME, TODO and other comment keywords.
- nestif # Reports deeply nested if statements.
- forbidigo # Forbids identifiers.
- predeclared # find code that shadows one of Go's predeclared identifiers.
- reassign # Checks that package variables are not reassigned.
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
- deadcode # The owner seems to have abandoned the linter. Replaced by unused.
- ifshort # The repository of the linter has been deprecated by the owner.
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt.
- tagliatelle # Checks the struct tags.
- nonamedreturns
- gosec
- staticcheck
- unused
- govet
linters-settings:
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
- name: exported
arguments:
- "disableStutteringCheck"
output:
sort-results: true