-
Notifications
You must be signed in to change notification settings - Fork 25
/
.golangci.yml
53 lines (50 loc) · 2.69 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
run:
timeout: 10m
issues-exit-code: 1
tests: true
linters:
# Enable specific linter
# https://golangci-lint.run/usage/linters/
enable:
- cyclop # Go linter that checks if the cyclic complexity of a function is acceptable
- dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f())
- dupl # Tool for code clone detection
- 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
- exportloopref # checks for pointers to enclosing loop variables
- funlen # Tool for detection of long functions
- gochecknoglobals # A global variable is a variable declared in package scope and that can be read and written to by any function within the package.
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
- goconst # Inspects source code for security problems
- gocyclo # Computes and checks the cyclomatic complexity of functions
- goerr113 # Golang linter to check the errors handling expressions
- 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.
- gomnd # An analyzer to detect magic numbers.
- goprintffuncname # Checks that printf-like functions are named with f at the end
- gosec # Inspects source code for security problems
- misspell # Finds commonly misspelled English words in comments
- nakedret # Finds naked returns in functions greater than a specified function length
- nestif # Reports deeply nested if statements
- nilerr # Finds the code that returns nil even if it checks that the error is not nil.
- noctx # noctx finds sending http request without context.Context
- nolintlint # Reports ill-formed or insufficient nolint directives
- prealloc # Finds slice declarations that could potentially be pre-allocated
- promlinter # Check Prometheus metrics naming via promlint
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint.
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
- whitespace # Tool for detection of leading and trailing whitespace
linters-settings:
funlen:
lines: 100
statements: 50
issues:
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- path: _test\.go
linters:
- gochecknoglobals
- gosec
- funlen
- noctx