-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.golangci.yml
131 lines (113 loc) · 3.91 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
---
run:
# default concurrency is a available CPU number
concurrency: 8
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: "60m"
# exit code when at least one issue was found, default is 1
issues-exit-code: 1
# include test files or not, default is true
tests: true
# 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.
skip-files:
- "cgo.go"
- ".*_gen.go$"
# output configuration options
output:
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is
# "colored-line-number"
format: "colored-line-number"
# print lines of code with issue, default is true
print-issued-lines: true
# print linter name in the end of issue text, default is true
print-linter-name: true
# make issues output unique by line, default is true
uniq-by-line: true
# add a prefix to the output file references; default is no prefix
path-prefix: ""
# sorts results by: filepath, line and column
sort-results: true
# all available settings of specific linters
linters-settings:
errcheck:
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
# default is false: such cases aren't reported by default.
check-type-assertions: false
# report about assignment of errors to blank identifier: `num, _ :=
# strconv.Atoi(numStr)`; default is false: such cases aren't reported by
# default.
check-blank: false
govet:
# report about shadowed variables
check-shadowing: false
gofmt:
# simplify code: gofmt with `-s` option, true by default
simplify: true
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes:
revive:
# see https://github.com/mgechev/revive#available-rules for details.
ignore-generated-header: false
severity: "warning"
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
rules:
- name: "blank-imports"
- name: "context-as-argument"
- name: "context-keys-type"
- name: "dot-imports"
- name: "error-return"
- name: "error-strings"
- name: "error-naming"
- name: "exported"
# - name: "if-return"
- name: "increment-decrement"
- name: "var-naming"
# - name: "var-declaration"
- name: "package-comments"
- name: "range"
- name: "receiver-naming"
- name: "time-naming"
- name: "unexported-return"
- name: "indent-error-flow"
- name: "errorf"
linters:
disable-all: true
enable:
- "deadcode"
- "errcheck"
- "gofmt"
- "goimports"
- "ineffassign"
- "revive"
- "structcheck"
- "unconvert"
- "varcheck"
- "vet"
issues:
# Independently from option `exclude` we use default exclude patterns,
# it can be disabled by this option. To list all
# excluded by default patterns execute `golangci-lint run --help`.
# Default value for this option is true.
exclude-use-default: false
# Excluding configuration per-path, per-linter, per-text and per-source
exclude-rules:
- linters:
- revive
source: "^// Deprecated:"
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
# Show only new issues: if there are unstaged changes or untracked files,
# only those changes are analyzed, else only changes in HEAD~ are analyzed.
# It's a super-useful option for integration of golangci-lint into existing
# large codebase. It's not practical to fix all existing issues at the moment
# of integration: much better don't allow issues in new code.
# Default is false.
new: false