forked from brianchenl/CloudIaC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
100 lines (87 loc) · 2.8 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
# Reference: https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
run:
# 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:
- var
# Which files to skip: they will be analyzed, but issues from them won't be reported.
# Default value is empty list,
# but there is no need to include all autogenerated files,
# we confidently recognize autogenerated files.
# If it's not please let us know.
# "/" will be replaced by current OS file path separator to properly work on Windows.
skip-files:
- ".+_test\\.go$"
linters-settings:
goheader:
# Supports two types 'const` and `regexp`.
# Values can be used recursively.
values:
const:
# Define here const type values in format k:v.
# For example:
# COMPANY: Hangzhou Yunji Technology Co., Ltd.
regexp:
# Define here regexp type values.
# for example:
# AUTHOR: .*@idcos\.com
# The template use for checking.
template: |-
Copyright (c) {{YEAR-RANGE}} CloudJ Technology Co., Ltd.
# As alternative of directive 'template', you may put the path to file with the template source.
# Useful if you need to load the template from a specific file.
#template-path: /path/to/my/template.tmpl
cyclop:
# The maximal code complexity to report.
max-complexity: 15
# The maximal average package complexity.
# If it's higher than 0.0 (float) the check is enabled
# Default: 0.0
package-average: 0.0
# Should ignore tests.
# Default: false
skip-tests: false
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: false
# Check for plain type assertions and type switches.
# Default: true
asserts: true
# Check for plain error comparisons.
# Default: true
comparison: true
linters:
# Disable all linters.
# disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
enable:
- deadcode
- errcheck
- errorlint
- goheader
- gosimple
- gosec
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- dupl
- cyclop
issues:
# Maximum issues count per one linter.
# Set to 0 to disable.
# Default: 50
max-issues-per-linter: 0
# Maximum count of issues with the same text.
# Set to 0 to disable.
# Default: 3
max-same-issues: 0