Skip to content

Commit f02f01a

Browse files
rewrite linter config / skip vendor lint checks
1 parent 763d6da commit f02f01a

File tree

2 files changed

+57
-67
lines changed

2 files changed

+57
-67
lines changed

.golangci.yml

Lines changed: 56 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,67 @@
1-
# This file contains all available configuration options
2-
# with their default values.
3-
4-
# options for analysis running
1+
version: "2"
52
run:
6-
# default concurrency is a available CPU number
73
concurrency: 16
8-
9-
# timeout for analysis, e.g. 30s, 5m, default is 1m
10-
timeout: 5m
11-
12-
# exit code when at least one issue was found, default is 1
134
issues-exit-code: 1
14-
15-
# include test files or not, default is true
165
tests: true
17-
18-
# list of build tags, all linters use it. Default is empty list.
19-
build-tags:
20-
21-
# which dirs to skip: they won't be analyzed;
22-
# can use regexp here: generated.*, regexp is applied on full path;
23-
# default value is empty list, but next dirs are always skipped independently
24-
# from this option's value:
25-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
26-
skip-dirs:
27-
- win_eventlog$
28-
# which files to skip: they will be analyzed, but issues from them
29-
# won't be reported. Default value is empty list, but there is
30-
# no need to include all autogenerated files, we confidently recognize
31-
# autogenerated files. If it's not please let us know.
32-
skip-files:
33-
# exclude autogenerated files
34-
- pkg/ingester/checkpoint.pb.go
35-
- pkg/logproto/logproto.pb.go
36-
- pkg/logql/expr.y.go
37-
- pkg/logql/log/jsonexpr/jsonexpr.y.go
38-
- pkg/logql/stats/stats.pb.go
39-
- pkg/querier/queryrange/queryrange.pb.go
40-
- pkg/valitail/server/ui/assets_vfsdata.go
41-
# output configuration options
426
output:
43-
# colored-line-number|line-number|json|tab|checkstyle, default is "colored-line-number"
44-
format: colored-line-number
45-
46-
# print lines of code with issue, default is true
47-
print-issued-lines: true
48-
49-
# print linter name in the end of issue text, default is true
50-
print-linter-name: true
51-
52-
linters-settings:
53-
goimports:
54-
local-prefixes: github.com/credativ/vali/pkg
55-
7+
formats:
8+
text:
9+
path: stdout
10+
print-linter-name: true
11+
print-issued-lines: true
5612
linters:
5713
enable:
58-
- errcheck
5914
- goconst
60-
- gofmt
61-
- goimports
62-
- gosimple
63-
- ineffassign
64-
- megacheck
6515
- misspell
6616
- unconvert
6717
- unparam
68-
- govet
69-
- unused # new from here.
70-
- typecheck
71-
72-
issues:
73-
exclude:
74-
- Error return value of .*log\.Logger\)\.Log\x60 is not checked
75-
- Error return value of .*.Log.* is not checked
76-
- '"io/ioutil" has been deprecated'
77-
- rand.Seed has been deprecated
18+
exclusions:
19+
generated: lax
20+
presets:
21+
- comments
22+
- common-false-positives
23+
- legacy
24+
- std-error-handling
25+
rules:
26+
- path: (.+)\.go$
27+
text: Error return value of .*log\.Logger\)\.Log\x60 is not checked
28+
- path: (.+)\.go$
29+
text: Error return value of .*.Log.* is not checked
30+
- path: (.+)\.go$
31+
text: '"io/ioutil" has been deprecated'
32+
- path: (.+)\.go$
33+
text: rand.Seed has been deprecated
34+
paths:
35+
- pkg/ingester/checkpoint.pb.go
36+
- pkg/logproto/logproto.pb.go
37+
- pkg/logql/expr.y.go
38+
- pkg/logql/log/jsonexpr/jsonexpr.y.go
39+
- pkg/logql/stats/stats.pb.go
40+
- pkg/querier/queryrange/queryrange.pb.go
41+
- pkg/valitail/server/ui/assets_vfsdata.go
42+
- win_eventlog$
43+
- third_party$
44+
- builtin$
45+
- examples$
46+
formatters:
47+
enable:
48+
- gofmt
49+
- goimports
50+
settings:
51+
goimports:
52+
local-prefixes:
53+
- github.com/credativ/vali/pkg
54+
exclusions:
55+
generated: lax
56+
paths:
57+
- pkg/ingester/checkpoint.pb.go
58+
- pkg/logproto/logproto.pb.go
59+
- pkg/logql/expr.y.go
60+
- pkg/logql/log/jsonexpr/jsonexpr.y.go
61+
- pkg/logql/stats/stats.pb.go
62+
- pkg/querier/queryrange/queryrange.pb.go
63+
- pkg/valitail/server/ui/assets_vfsdata.go
64+
- win_eventlog$
65+
- third_party$
66+
- builtin$
67+
- examples$

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ publish: dist
244244
########
245245

246246
lint:
247-
GOGC=10 golangci-lint run -v --timeout 60m $(GOLANGCI_ARG)
247+
GOGC=10 golangci-lint run -v --timeout 60m
248248
faillint -paths "sync/atomic=go.uber.org/atomic" ./...
249249

250250
########

0 commit comments

Comments
 (0)