Skip to content

Commit 3684ee5

Browse files
author
Calvin Lobo
committed
upgrade lint config to v2
1 parent b903e2f commit 3684ee5

File tree

1 file changed

+42
-59
lines changed

1 file changed

+42
-59
lines changed

.golangci.yaml

Lines changed: 42 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,52 @@
1-
# options for analysis running
2-
run:
3-
# timeout for analysis, e.g. 30s, 5m, default is 1m
4-
timeout: 2m
5-
6-
issues:
7-
# Only report issues for changes since master
8-
new-from-rev: origin/master
9-
10-
# output configuration options
1+
version: "2"
112
output:
12-
# colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number"
133
formats:
14-
- format: colored-line-number
15-
16-
linters-settings:
17-
errcheck:
18-
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
19-
# default is false: such cases aren't reported by default.
20-
check-type-assertions: true
21-
22-
# Function length check
23-
funlen:
24-
lines: 60
25-
statements: 40
26-
27-
# Report deeply nested if statements
28-
nestif:
29-
# minimal complexity of if statements to report, 5 by default
30-
min-complexity: 4
31-
32-
gofmt:
33-
# simplify code: gofmt with `-s` option, true by default
34-
simplify: true
35-
36-
govet:
37-
# report about shadowed variables
38-
enable-all: true
39-
disable:
40-
# Do not check field memory alignment because in most cases the performance gain is not worth the headache
41-
- fieldalignment
42-
4+
text:
5+
path: stdout
436
linters:
44-
# Disable the default linters so we can explicitly name the linters we want
45-
disable-all: true
46-
47-
# List of enabled linters
7+
default: none
488
enable:
49-
#####################
50-
# Default linters
51-
#####################
52-
- gofmt
53-
# Checks error handling
549
- errcheck
55-
# Linter for Go source code that specializes in simplifying a code
56-
- gosimple
57-
# Vet examines Go source code and reports suspicious constructs, such as Printf calls whose
58-
# arguments do not align with the format string
5910
- govet
60-
# Detects when assignments to existing variables are not used
6111
- ineffassign
62-
# Static code analytics
6312
- staticcheck
64-
# Reports unused function parameters.
13+
- unconvert
6514
- unparam
66-
# Check if variables or functions are unused
6715
- unused
68-
# Remove unnecessary type conversions.
69-
- unconvert
16+
settings:
17+
errcheck:
18+
check-type-assertions: true
19+
funlen:
20+
lines: 60
21+
statements: 40
22+
govet:
23+
disable:
24+
- fieldalignment
25+
enable-all: true
26+
nestif:
27+
min-complexity: 4
28+
exclusions:
29+
generated: lax
30+
presets:
31+
- comments
32+
- common-false-positives
33+
- legacy
34+
- std-error-handling
35+
paths:
36+
- third_party$
37+
- builtin$
38+
- examples$
39+
issues:
40+
new-from-rev: origin/master
41+
formatters:
42+
enable:
43+
- gofmt
44+
settings:
45+
gofmt:
46+
simplify: true
47+
exclusions:
48+
generated: lax
49+
paths:
50+
- third_party$
51+
- builtin$
52+
- examples$

0 commit comments

Comments
 (0)