forked from huaweicloud/terraform-provider-huaweicloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yml
160 lines (157 loc) · 5 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Options for analysis running.
run:
# See the dedicated "run" documentation section.
timeout: 5m
# Which dirs to skip: issues from them won't be reported.
# Can use regexp here: `generated.*`, regexp is applied on full path.
# Default value is empty list,
# but default dirs are skipped independently of this option's value (see skip-dirs-use-default).
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-dirs:
- huaweicloud/services/deprecated
- huaweicloud/services/acceptance/deprecated
linters:
# Disable all linters.
# Default: false
disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- gci
- gocritic
- gocyclo
- gosec
- nestif
- misspell
- unconvert
- revive
linters-settings:
staticcheck:
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ["all"]
gosimple:
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ["all"]
stylecheck:
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ["all", "-ST1000", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
gocyclo:
# Minimal code complexity to report.
# Default: 30 (but we recommend 10-20)
min-complexity: 20
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 15
misspell:
# Correct spellings using locale preferences for US or UK.
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
# Default is to use a neutral variety of English.
locale: US
ignore-words:
- classis
- cancelled
- criterias
- analyses
- versoin
gci:
# 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
- default
# Custom section: groups all imports with the specified Prefix.
- prefix(github.com/chnsz/golangsdk)
- prefix(github.com/huaweicloud/huaweicloud-sdk-go-v3)
- prefix(github.com/huaweicloud/terraform-provider-huaweicloud)
- 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: false
# Enable custom order of sections.
# If `true`, make the section order the same as the order of `sections`.
# Default: false
custom-order: true
gosec:
# To select a subset of rules to run.
# Available rules: https://github.com/securego/gosec#available-rules
# Default: [] - means include all rules
severity: medium
confidence: medium
revive:
enable-all-rules: true
severity: warning
rules:
- name: var-naming
disabled: false
arguments:
- ["API", "ID", "IDS", "IP", "VM", "JSON", "HTTP", "URL", "XML", "YAML", "CSS", "ACL", "CPU", "SQL"] # AllowList
- [] # DenyList
- name: argument-limit
disabled: false
arguments: [6]
- name: function-result-limit
disabled: false
arguments: [4]
- name: line-length-limit
disabled: false
arguments: [150]
- name: add-constant
disabled: true
- name: banned-characters
disabled: true
- name: cyclomatic
disabled: true
- name: cognitive-complexity
disabled: true
- name: max-public-structs
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: unhandled-error
disabled: true
- name: bare-return
disabled: true
- name: flag-parameter
disabled: true
- name: use-any
disabled: true
- name: unchecked-type-assertion
disabled: true
issues:
# List of regexps of issue texts to exclude.
#
# But independently of this option we use default exclude patterns,
# it can be disabled by `exclude-use-default: false`.
# To list all excluded by default patterns execute `golangci-lint run --help`
#
# Default: []
exclude:
- "Error return value of `d.Set` is not checked"
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
# Exclude some linters from running on tests files.
- path: _test\.go
text: "var-naming: don't use underscores in Go names"
linters:
- revive
- path: _test\.go
text: "confusing-naming:"
linters:
- revive