forked from nginxinc/nginx-go-crossplane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
93 lines (85 loc) · 2.09 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
# GolangCI-Lint settings
# Disable all linters and enable the required ones
linters:
enable-all: true
disable:
- cyclop
- depguard
- varnamelen
- goimports # handled by `make format`
- gofmt # handled by `make format`
- wsl # hyper specific to a the creator and not configurable enough to be useful - https://github.com/bombsimon/wsl
- dupl
- gomnd
- godox
- nlreturn
- wrapcheck
- thelper
- testpackage
- nestif
- gofumpt
- goerr113
- errorlint
- ifshort
- paralleltest
- interfacer
- golint
- maligned
- scopelint
- exhaustruct
# deprecated
- deadcode
- varcheck
- structcheck
- nosnakecase
- exhaustivestruct
# Run options
run:
# 10 minute timeout for analysis
timeout: 10m
modules-download-mode: vendor
skip-dirs-use-default: true
# Specific linter settings
linters-settings:
gocyclo:
# Minimal code complexity to report
min-complexity: 16
maligned:
# Print struct with more effective memory layout
suggest-new: true
govet:
# Report shadowed variables
check-shadowing: true
misspell:
# Correct spellings using locale preferences for US
locale: US
goimports:
# Put imports beginning with prefix after 3rd-party packages
local-prefixes: gitswarm.f5net.com/indigo,gitlab.com/f5
errcheck:
ignore: ^Close.*,os:^Setenv.*,fmt:.*,io/ioutil:^Read.*,github.com/spf13/viper:.*,github.com/pkg/errors:^Wrap.*
lll:
line-length: 140
issues:
# Exclude configuration
exclude-rules:
# Exclude gochecknoinits and gosec from running on tests files
- path: _test\.go
linters:
- gochecknoinits
- gosec
- path: test/*
linters:
- gochecknoinits
- gosec
# Exclude lll issues for long lines with go:generate
- linters:
- lll
source: "^//go:generate "
- path: _desiredstatehistory(|_test)\.go
linters:
- dupl
# Disable maximum issues count per one linter
max-issues-per-linter: 0
# Disable maximum count of issues with the same text
max-same-issues: 0