forked from castle/castle-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
96 lines (92 loc) · 4.7 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
# options for analysis running
run:
timeout: 10m
tests: true
silent: true
# output configuration options
output:
format: colored-line-number
print-issued-lines: true
print-linter-name: true
# all available settings of specific linters
linters-settings:
errcheck:
check-type-assertions: true
check-blank: true
errorlint:
asserts: false
comparison: false
gci:
sections:
- standard
- default
- prefix(github.com/utilitywarehouse/castle-go)
gofumpt:
extra-rules: true
govet:
check-shadowing: false
disable:
- shadow
misspell:
locale: UK
nakedret:
max-func-lines: 30
prealloc:
simple: true
range-loops: true
for-loops: true
revive:
rules:
- name: package-comments
disabled: true
unparam:
algo: cha
unused:
check-exported: false
linters:
enable:
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers [fast: true]
- bidichk # Simple linter to check that your code does not contain Unicode bidirectional control characters [fast: true]
- durationcheck # Check that duration constants are multiplied by time.Second [fast: true]
- errname # Checks that sentinel errors are prefixed with the `Err` or `Err...` [fast: true]
- 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. [fast: true]
- exhaustive # check exhaustiveness of enum switch statements [fast: true]
- exportloopref # checks for pointers to enclosing loop variables [fast: true]
- gci # Gci control golang package import order and make it always deterministic. [fast: true]
- gofumpt # Gofumpt checks whether code was gofumpt-ed. [fast: true]
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true]
- gomoddirectives # Checks that go.mod file has the expected directives [fast: true]
- gosec # Inspects source code for security problems [fast: false]
- importas # Checks that import aliases are not redundant [fast: true]
- makezero # Finds slice declarations without explicit initial length [fast: true]
- misspell # Finds commonly misspelled English words in comments [fast: true]
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true]
- nestif # Reports deeply nested if statements [fast: true]
- nilerr # Reports an error if a function returns a nil error. [fast: true]
- noctx # noctx finds sending http request without context.Context [fast: true]
- prealloc # Finds slice declarations that could potentially be preallocated [fast: true]
- predeclared # Finds code that shadows one of Go's predeclared identifiers [fast: true]
- promlinter # Linter for Prometheus client_golang metrics naming [fast: true]
- revive # Revive replaces golint
- rowserrcheck # Checks whether Err of rows is checked successfully [fast: true]
- sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: true]
- tenv # tenv is a linter that checks for hardcoded test environment variables. [fast: true]
- thelper # thelper is a linter that helps you to implement the Thelper pattern. [fast: true]
- tparallel # tparallel detects inappropriate usage of t.Parallel() method [fast: true]
- unconvert # Remove unnecessary type conversions [fast: false]
- unparam # Reports unused function parameters [fast: false]
- wastedassign # wastedassign finds wasted assignment statements. [fast: true]
disable:
- deadcode # Finds unused code [fast: false]
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: false]
- dupl # Tool for code clone detection [fast: true]
- goconst # Finds repeated strings that could be replaced by a constant [fast: true]
- gocyclo # Computes and checks the cyclomatic complexity of functions [fast: true]
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true]
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true]
- gosimple # Linter for Go source code that specializes in simplifying a code [fast: false]
- interfacer # Linter that suggests narrower interface types [fast: false]
- lll # Reports long lines [fast: true]
- maligned # Tool to detect Go structs that would take less memory if their fields were sorted [fast: false]
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false]
- varcheck # Finds unused global variables and constants [fast: false]