forked from openshift/installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
134 lines (134 loc) · 4.28 KB
/
.golangci.yaml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
run:
timeout: 20m
skip-dirs:
- ^bin
- ^data/data
- ^docs
- ^hack
- ^images
- ^scripts
- ^terraform
- ^upi
go: '1.19'
modules-download-mode: vendor
output:
print-linter-name: true
sort-results: true
uniq-by-line: false
linters:
enable:
- asciicheck
- containedctx
- decorder
- depguard
- dogsled
- errcheck
- errorlint
- exportloopref
- goconst
- gocritic
- gocyclo
- godot
- gofmt
- goimports
- gosec
- gosimple
- govet
- importas
- ineffassign
- misspell
- nakedret
- prealloc
- predeclared
- revive
- staticcheck
- stylecheck
- tenv
- thelper
- typecheck
- unconvert
- unused
- whitespace
linters-settings:
errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
# Such cases aren't reported by default.
# Default: false
check-type-assertions: true
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
# Such cases aren't reported by default.
# Default: false
check-blank: true
# DEPRECATED comma-separated list of pairs of the form pkg:regex
#
# the regex is used to ignore names within pkg. (default "fmt:.*").
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
ignore: fmt:.*,io/ioutil:^Read.*
# To disable the errcheck built-in exclude list.
# See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details.
# Default: false
disable-default-exclusions: true
# DEPRECATED use exclude-functions instead.
#
# Path to a file containing a list of functions to exclude from checking.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
# exclude: /path/to/file.txt
# List of functions to exclude from checking, where each entry is a single function to exclude.
# See https://github.com/kisielk/errcheck#excluding-functions for details.
exclude-functions:
- io/ioutil.ReadFile
- io.Copy(*bytes.Buffer)
- io.Copy(os.Stdout)
errorlint:
# Check whether fmt.Errorf uses the %w verb for formatting errors.
# See the https://github.com/polyfloyd/go-errorlint for caveats.
# Default: true
errorf: true
# Check for plain type assertions and type switches.
# Default: true
asserts: true
# Check for plain error comparisons.
# Default: true
comparison: true
gci:
# DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.
# local-prefixes: github.com/org/project
#
# Section configuration to compare against.
# Section names are case-insensitive and may contain parameters in ().
# The default order of sections is `standard > default > custom > blank > dot`,
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/openshift) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
# - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
# Skip generated files.
# Default: true
skip-generated: true
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
gofumpt:
# Select the Go version to target.
# Default: "1.15"
# Deprecated: use the global `run.go` instead.
# lang-version: "1.17"
# Module path which contains the source code being formatted.
# Default: ""
module-path: github.com/openshift/installer
# Choose whether to use the extra rules.
# Default: false
extra-rules: true
goimports:
# Put imports beginning with prefix after 3rd-party packages.
# It's a comma-separated list of prefixes.
# Default: ""
local-prefixes: github.com/openshift
issues:
include:
- EXC0012 # EXC0012 revive: issue about not having a comment on exported.
- EXC0014 # EXC0014 revive: issue about not having a comment in the right format.