-
Notifications
You must be signed in to change notification settings - Fork 6
/
.golangci.yml
65 lines (61 loc) · 3.85 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
run:
timeout: 10m
linters-settings:
gci:
# put imports beginning with prefix after 3rd-party packages;
local-prefixes: github.com/ziyan/gatewaysshd/
gocritic:
disabled-checks:
- ifElseChain
- singleCaseSwitch
linters:
fast: false
enable-all: true
disable:
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted
- cyclop # checks function and package cyclomatic complexity
- dupl # Tool for code clone detection
- exhaustivestruct # check exhaustiveness of enum switch statements
- funlen # Tool for detection of long functions
- gochecknoglobals # check that no global variables exist
- gochecknoinits # Checks that no init functions are present in Go code
- gocognit # Computes and checks the cognitive complexity of functions
- goconst # Finds repeated strings that could be replaced by a constant
- gocyclo # Computes and checks the cyclomatic complexity of functions
- godot # Check if comments end in a period
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
- goimports # In addition to fixing imports, goimports also formats your code in the same style as gofmt
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes
- gomnd # An analyzer to detect magic numbers.
- gomoddirectives # Manage the use of 'replace', 'retract', and 'excludes' directives in go.mod.
- gomodguard # Allow and block list linter for direct Go module dependencies.
- importas # Enforces consistent import aliases
- interfacer # Linter that suggests narrower interface types
- ireturn # Accept Interfaces, Return Concrete Types
- lll # Reports long lines [fast: true, auto-fix: false]
- nlreturn # nlreturn checks for a new line before return and branch statements to increase code clarity
- nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]
- promlinter # Check Prometheus metrics naming via promlint [fast: true, auto-fix: false]
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go
- scopelint # Scopelint checks for unpinned variables in go programs
- stylecheck # Stylecheck is a replacement for golint
- dogsled
- varnamelen # checks that the length of a variable's name matches its scope
- wrapcheck # Checks that errors returned from external packages are wrapped
- wsl # [too specific] Whitespace Linter - Forces you to use empty lines!
- ifshort # [takes forever to run!] Checks that your code uses short syntax for if-statements whenever possible
- goerr113 # Golang linter to check the errors handling expressions
# the ones below are disabled but I think we can and should enable them soon
- gofumpt # Gofumpt checks whether code was gofumpt-ed
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
- exhaustive # check exhaustiveness of enum switch statements
- forcetypeassert # finds forced type assertion
- goconst # Finds repeated strings that could be replaced by a constant
- godox # Tool for detection of FIXME, TODO and other comment keywords
- gosec # (gas) Inspects source code for security problems
- nestif # Reports deeply nested if statements
- nilnil # Checks that there is no simultaneous return of `nil` error and an invalid value.
- testpackage # linter that makes you use a separate _test package
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers
- paralleltest # paralleltest detects missing usage of t.Parallel() method in your Go test
- unparam # Reports unused function parameters