1- # This file contains all available configuration options
2- # with their default values.
1+ version : " 2"
32
4- # options for analysis running
53run :
6- # default concurrency is a available CPU number
7- concurrency : 4
8-
9- # timeout for analysis, e.g. 30s, 5m, default is 1m
10- timeout : 5m
11-
12- # exit code when at least one issue was found, default is 1
13- issues-exit-code : 1
14-
15- # include test files or not, default is true
16- tests : true
17- # list of build tags, all linters use it. Default is empty list.
18- build-tags :
19- - e2e
20-
21- # which dirs to skip: issues from them won't be reported;
22- # can use regexp here: generated.*, regexp is applied on full path;
23- # default value is empty list, but default dirs are skipped independently
24- # from this option's value (see skip-dirs-use-default).
25- # "/" will be replaced by current OS file path separator to properly work
26- # on Windows.
27- skip-dirs :
28- - vendor
29-
30- # default is true. Enables skipping of directories:
31- # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
32- skip-dirs-use-default : true
33-
34- # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
35- # If invoked with -mod=readonly, the go command is disallowed from the implicit
36- # automatic updating of go.mod described above. Instead, it fails when any changes
37- # to go.mod are needed. This setting is most useful to check that go.mod does
38- # not need updates, such as in a continuous integration and testing system.
39- # If invoked with -mod=vendor, the go command assumes that the vendor
40- # directory holds the correct copies of dependencies and ignores
41- # the dependency descriptions in go.mod.
42- modules-download-mode : vendor
43-
44- # Allow multiple parallel golangci-lint instances running.
45- # If false (default) - golangci-lint acquires file lock on start.
46- allow-parallel-runners : false
47-
48-
49- # output configuration options
50- output :
51- # colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
52- # default is "colored-line-number"
53- format : tab
54-
55- # print lines of code with issue, default is true
56- print-issued-lines : true
57-
58- # print linter name in the end of issue text, default is true
59- print-linter-name : true
60-
61- # make issues output unique by line, default is true
62- uniq-by-line : true
63-
64- # add a prefix to the output file references; default is no prefix
65- path-prefix : " "
66-
67- # sorts results by: filepath, line and column
68- sort-results : false
4+ timeout : 10m
5+ allow-parallel-runners : true
696
707linters :
71- disable-all : true
8+ default : none
729 enable :
10+ - asasalint
11+ - asciicheck
12+ - bidichk
13+ - bodyclose
14+ - canonicalheader
15+ - contextcheck
16+ - copyloopvar
17+ - decorder
18+ - depguard
19+ - dupword
7320 - errcheck
74- - gofmt
75- - goimports
21+ - errchkjson
22+ - errname
23+ - errorlint
24+ - fatcontext
25+ - forbidigo
26+ - forcetypeassert
27+ - funcorder
28+ - gocheckcompilerdirectives
29+ - goconst
30+ - gocritic
31+ - godot
32+ - goheader
33+ - goprintffuncname
7634 - gosec
77- - gosimple
35+ - gosmopolitan
7836 - govet
79- - ineffassign
37+ - grouper
38+ - iface
39+ - importas
40+ - intrange
41+ - makezero
8042 - misspell
43+ - musttag
44+ - nakedret
45+ - nestif
46+ - nilerr
47+ - nosprintfhostport
48+ - prealloc
49+ - predeclared
50+ - reassign
51+ - recvcheck
8152 - staticcheck
82- - typecheck
53+ - tagalign
54+ - unconvert
55+ - unparam
8356 - unused
84- fast : false
85-
86- linters-settings :
87- goimports :
88- # put imports beginning with prefix after 3rd-party packages;
89- # it's a comma-separated list of prefixes
90- local-prefixes : github.com/openshift/cert-manager-operator
57+ - wastedassign
58+ - whitespace
59+ - wrapcheck
60+ disable :
61+ # Below linters will be enabled once the issues reported by enabled linters are fixed.
62+ - dupl
63+ - cyclop
64+ - gocyclo
65+ - gocognit
66+ - err113
67+ - revive
68+ - maintidx
69+ - mnd
70+ # Below linters will be enabled when the golangci-lint is upgraded to the version supporting these.
71+ # - embeddedstructfieldcheck
72+ # - godoclint
73+ # - iotamixing
74+ # - modernize
75+
76+ exclusions :
77+ # Mode of the generated files analysis.
78+ #
79+ # - `strict`: sources are excluded by strictly following the Go generated file convention.
80+ # Source files that have lines matching only the following regular expression will be excluded: `^// Code generated .* DO NOT EDIT\.$`
81+ # This line must appear before the first non-comment, non-blank text in the file.
82+ # https://go.dev/s/generatedcode
83+ # - `lax`: sources are excluded if they contain lines like `autogenerated file`, `code generated`, `do not edit`, etc.
84+ # - `disable`: disable the generated files exclusion.
85+ #
86+ # Default: strict
87+ generated : lax
88+ # Log a warning if an exclusion rule is unused.
89+ # Default: false
90+ warn-unused : true
91+ # Predefined exclusion rules.
92+ # Default: []
93+ presets :
94+ - comments
95+ - std-error-handling
96+ - common-false-positives
97+ - legacy
98+ # Excluding configuration per-path, per-linter, per-text and per-source.
99+ rules :
100+ # Exclude some linters from running on tests files.
101+ - path : _test\.go
102+ linters :
103+ - gocyclo
104+ - errcheck
105+ - dupl
106+ - gosec
107+ - wrapcheck
108+ - mnd
109+ # Run some linter only for test files by excluding its issues for everything else.
110+ - path-except : _test\.go
111+ linters :
112+ - forbidigo
113+ - path : pkg/operators
114+ linters :
115+ - all
116+ formatters :
117+ settings :
118+ gci :
119+ # Section configuration to compare against.
120+ # Section names are case-insensitive and may contain parameters in ().
121+ # The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`.
122+ # If `custom-order` is `true`, it follows the order of `sections` option.
123+ # Default: ["standard", "default"]
124+ sections :
125+ - standard # Standard section: captures all standard packages.
126+ - default # Default section: contains all imports that could not be matched to another section type.
127+ - prefix(github.com/openshift/cert-manager-operator) # Custom section: groups all imports with the specified Prefix.
128+ - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
129+ - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
130+ - alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
131+ - localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
132+ # Checks that no inline comments are present.
133+ # Default: false
134+ no-inline-comments : true
135+ # Checks that no prefix comments (comment lines above an import) are present.
136+ # Default: false
137+ no-prefix-comments : true
138+ # Enable custom order of sections.
139+ # If `true`, make the section order the same as the order of `sections`.
140+ # Default: false
141+ custom-order : true
142+ # Drops lexical ordering for custom sections.
143+ # Default: false
144+ no-lex-order : true
145+ gofmt :
146+ # Simplify code: gofmt with `-s` option.
147+ # Default: true
148+ simplify : false
149+ # Apply the rewrite rules to the source before reformatting.
150+ # https://pkg.go.dev/cmd/gofmt
151+ # Default: []
152+ rewrite-rules :
153+ - pattern : ' interface{}'
154+ replacement : ' any'
155+ - pattern : ' a[b:len(a)]'
156+ replacement : ' a[b:]'
157+ gofumpt :
158+ # Module path which contains the source code being formatted.
159+ # Default: ""
160+ module-path : github.com/openshift/cert-manager-operator
161+ # Choose whether to use the extra rules.
162+ # Default: false
163+ extra-rules : true
164+ goimports :
165+ # A list of prefixes, which, if set, checks import paths
166+ # with the given prefixes are grouped after 3rd-party packages.
167+ # Default: []
168+ local-prefixes :
169+ - github.com/openshift/cert-manager-operator
170+ golines :
171+ # Target maximum line length.
172+ # Default: 100
173+ max-len : 200
174+ # Length of a tabulation.
175+ # Default: 4
176+ tab-len : 8
177+ # Shorten single-line comments.
178+ # Default: false
179+ shorten-comments : true
180+ # Default: true
181+ reformat-tags : false
182+ # Split chained methods on the dots as opposed to the arguments.
183+ # Default: true
184+ chain-split-dots : false
0 commit comments