11# Copyright (c) HashiCorp, Inc.
22# SPDX-License-Identifier: BUSL-1.1
33
4+ version : " 2"
5+ run :
6+ concurrency : 4
47linters :
5- disable-all : true
8+ default : none
69 enable :
7- - gofmt
10+ - depguard
11+ - forbidigo
12+ - gomodguard
813 - govet
9- - unconvert
10- - staticcheck
1114 - ineffassign
15+ - staticcheck
16+ - unconvert
1217 - unparam
13- - forbidigo
14- - gomodguard
15- - depguard
16-
17- issues :
18- # Disable the default exclude list so that all excludes are explicitly
19- # defined in this file.
20- exclude-use-default : false
21-
22- exclude-rules :
23- # Temp Ignore SA9004: only the first constant in this group has an explicit type
24- # https://staticcheck.io/docs/checks#SA9004
25- - linters : [staticcheck]
26- text : " SA9004:"
27-
28- - linters : [staticcheck]
29- text : " SA1006:"
30-
31- - linters : [staticcheck]
32- text : ' SA1019: "io/ioutil" has been deprecated since Go 1.16'
33-
34- # Allow usage of deprecated values.
35- - linters : [ staticcheck ]
36- text : ' SA1019:'
37- path : " (agent/grpc-external|agent/grpc-internal)"
38-
39- # An argument that always receives the same value is often not a problem.
40- - linters : [unparam]
41- text : " always receives"
42-
43- - linters : [ unparam ]
44- text : ' result \d+ \(bool\) is always false'
45-
46- # Often functions will implement an interface that returns an error without
47- # needing to return an error. Sometimes the error return value is unnecessary
48- # but a linter can not tell the difference.
49- - linters : [unparam]
50- text : ' result \d+ \(error\) is always nil'
51-
52- # Allow unused parameters to start with an underscore. Arguments with a name
53- # of '_' are already ignored.
54- # Ignoring longer names that start with underscore allow for better
55- # self-documentation than a single underscore by itself. Underscore arguments
56- # should generally only be used when a function is implementing an interface.
57- - linters : [unparam]
58- text : " `_[^`]*` is unused"
59-
60- # Temp ignore some common unused parameters so that unparam can be added
61- # incrementally.
62- - linters : [unparam]
63- text : " `(t|resp|req|entMeta)` is unused"
64-
65- # Temp ignore everything in _ce(_test).go and _ent(_test).go. Many of these
66- # could use underscore to ignore the unused arguments, but the "always returns"
67- # issue will likely remain in CE, and will need to be excluded.
68- - linters : [unparam]
69- path : " (_ce.go|_ce_test.go|_ent.go|_ent_test.go)"
70-
71- - linters : [ staticcheck ]
72- text : ' SA1019:'
73-
74- linters-settings :
75- govet :
76- enable-all : true
77- disable :
78- - fieldalignment
79- - nilness
80- - shadow
81- - unusedwrite
82- - printf
83- gofmt :
84- simplify : true
85- forbidigo :
86- # Forbid the following identifiers (list of regexp).
87- # Format includes custom message based on https://github.com/ashanbrown/forbidigo/pull/11
88- forbid :
89- - ' \bhtml\/template\b(# Use text/template instead)?'
90- - ' \bioutil\b(# Use io and os packages instead of ioutil)?'
91- - ' \brequire\.New\b(# Use package-level functions with explicit TestingT)?'
92- - ' \bassert\.New\b(# Use package-level functions with explicit TestingT)?'
93- # Exclude godoc examples from forbidigo checks.
94- # Default: true
95- exclude_godoc_examples : false
96- gomodguard :
97- blocked :
98- # List of blocked modules.
99- modules :
100- # Blocked module.
101- - github.com/hashicorp/net-rpc-msgpackrpc :
102- recommendations :
103- - github.com/hashicorp/consul-net-rpc/net-rpc-msgpackrpc
104- - github.com/hashicorp/go-msgpack :
105- recommendations :
106- - github.com/hashicorp/consul-net-rpc/go-msgpack
107- - github.com/golang/protobuf :
108- recommendations :
109- - google.golang.org/protobuf
110-
111- depguard :
18+ settings :
19+ depguard :
20+ rules :
21+ main :
22+ deny :
23+ - pkg : net/rpc
24+ desc : only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc
25+ - pkg : github.com/golang/protobuf
26+ desc : only use google.golang.org/protobuf
27+ forbidigo :
28+ forbid :
29+ - pattern : \bhtml\/template\b(# Use text/template instead)?
30+ - pattern : \bioutil\b(# Use io and os packages instead of ioutil)?
31+ - pattern : \brequire\.New\b(# Use package-level functions with explicit TestingT)?
32+ - pattern : \bassert\.New\b(# Use package-level functions with explicit TestingT)?
33+ gomodguard :
34+ blocked :
35+ modules :
36+ - github.com/hashicorp/net-rpc-msgpackrpc :
37+ recommendations :
38+ - github.com/hashicorp/consul-net-rpc/net-rpc-msgpackrpc
39+ - github.com/hashicorp/go-msgpack :
40+ recommendations :
41+ - github.com/hashicorp/consul-net-rpc/go-msgpack
42+ - github.com/golang/protobuf :
43+ recommendations :
44+ - google.golang.org/protobuf
45+ govet :
46+ disable :
47+ - fieldalignment
48+ - nilness
49+ - shadow
50+ - unusedwrite
51+ - printf
52+ enable-all : true
53+ exclusions :
54+ generated : lax
11255 rules :
113- main :
114- listMode : lax
115- deny :
116- - pkg : net/rpc
117- desc : " only use forked copy in github.com/hashicorp/consul-net-rpc/net/rpc"
118- - pkg : github.com/golang/protobuf
119- desc : " only use google.golang.org/protobuf"
120-
121- run :
122- timeout : 10m
123- concurrency : 4
124- skip-dirs-use-default : false
56+ - linters :
57+ - staticcheck
58+ text : ' SA9004:'
59+ - linters :
60+ - staticcheck
61+ text : ' SA1006:'
62+ - linters :
63+ - staticcheck
64+ text : ' SA1019: "io/ioutil" has been deprecated since Go 1.16'
65+ - linters :
66+ - staticcheck
67+ path : (agent/grpc-external|agent/grpc-internal)
68+ text : ' SA1019:'
69+ - linters :
70+ - unparam
71+ text : always receives
72+ - linters :
73+ - unparam
74+ text : result \d+ \(bool\) is always false
75+ - linters :
76+ - unparam
77+ text : result \d+ \(error\) is always nil
78+ - linters :
79+ - unparam
80+ text : ' `_[^`]*` is unused'
81+ - linters :
82+ - unparam
83+ text : ' `(t|resp|req|entMeta)` is unused'
84+ - linters :
85+ - unparam
86+ path : (_ce.go|_ce_test.go|_ent.go|_ent_test.go)
87+ - linters :
88+ - staticcheck
89+ text : ' SA1019:'
90+ - linters :
91+ - staticcheck
92+ text : ' ST1005: error strings should not end with punctuation or newlines'
93+ - linters :
94+ - staticcheck
95+ text : ' ST1012: error var injectedError should have name of the form errFo'
96+ - linters :
97+ - staticcheck
98+ text : ' ST1005: error strings should not be capitalized'
99+ - linters :
100+ - staticcheck
101+ text : ' ST1012: error var'
102+ paths :
103+ - third_party$
104+ - builtin$
105+ - examples$
106+ - agent/consul
107+ formatters :
108+ enable :
109+ - gofmt
110+ settings :
111+ gofmt :
112+ simplify : true
113+ exclusions :
114+ generated : lax
115+ paths :
116+ - third_party$
117+ - builtin$
118+ - examples$
0 commit comments