File tree Expand file tree Collapse file tree 7 files changed +42
-52
lines changed Expand file tree Collapse file tree 7 files changed +42
-52
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,3 @@ require (
26
26
google.golang.org/genproto/googleapis/rpc v0.0.0-20250825161204-c5933d9347a5 // indirect
27
27
gopkg.in/yaml.v3 v3.0.1 // indirect
28
28
)
29
-
30
- // Bad imports are sometimes causing attempts to pull that code.
31
- // This makes the error more explicit.
32
- replace (
33
- go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
34
- go.etcd.io/etcd/api/v3 => ./FORBIDDEN_DEPENDENCY
35
- go.etcd.io/etcd/pkg/v3 => ./FORBIDDEN_DEPENDENCY
36
- go.etcd.io/etcd/tests/v3 => ./FORBIDDEN_DEPENDENCY
37
- go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
38
- )
Original file line number Diff line number Diff line change @@ -46,12 +46,3 @@ replace (
46
46
go.etcd.io/etcd/api/v3 => ../../api
47
47
go.etcd.io/etcd/client/pkg/v3 => ../pkg
48
48
)
49
-
50
- // Bad imports are sometimes causing attempts to pull that code.
51
- // This makes the error more explicit.
52
- replace (
53
- go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
54
- go.etcd.io/etcd/pkg/v3 => ./FORBIDDEN_DEPENDENCY
55
- go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
56
- go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
57
- )
Original file line number Diff line number Diff line change @@ -54,11 +54,3 @@ replace (
54
54
go.etcd.io/etcd/client/v3 => ../client/v3
55
55
go.etcd.io/etcd/pkg/v3 => ../pkg
56
56
)
57
-
58
- // Bad imports are sometimes causing attempts to pull that code.
59
- // This makes the error more explicit.
60
- replace (
61
- go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
62
- go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
63
- go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
64
- )
Original file line number Diff line number Diff line change @@ -12,14 +12,6 @@ replace (
12
12
go.etcd.io/etcd/server/v3 => ../server
13
13
)
14
14
15
- // Bad imports are sometimes causing attempts to pull that code.
16
- // This makes the error more explicit.
17
- replace (
18
- go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
19
- go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
20
- go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
21
- )
22
-
23
15
require (
24
16
github.com/coreos/go-semver v0.3.1
25
17
github.com/dustin/go-humanize v1.0.1
Original file line number Diff line number Diff line change @@ -32,14 +32,3 @@ require (
32
32
)
33
33
34
34
replace go.etcd.io/etcd/client/pkg/v3 => ../client/pkg
35
-
36
- // Bad imports are sometimes causing attempts to pull that code.
37
- // This makes the error more explicit.
38
- // Etcd contains lots of packages and dependency relationship.
39
- // Shouldn't import unnecessary dependencies
40
- replace (
41
- go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
42
- go.etcd.io/etcd/api/v3 => ./FORBIDDEN_DEPENDENCY
43
- go.etcd.io/etcd/tests/v3 => ./FORBIDDEN_DEPENDENCY
44
- go.etcd.io/etcd/v3 => ./FORBIDDEN_DEPENDENCY
45
- )
Original file line number Diff line number Diff line change @@ -82,9 +82,3 @@ replace (
82
82
go.etcd.io/etcd/client/v3 => ../client/v3
83
83
go.etcd.io/etcd/pkg/v3 => ../pkg
84
84
)
85
-
86
- // Bad imports are sometimes causing attempts to pull that code.
87
- // This makes the error more explicit.
88
- replace go.etcd.io/etcd => ./FORBIDDEN_DEPENDENCY
89
-
90
- replace go.etcd.io/tests/v3 => ./FORBIDDEN_DEPENDENCY
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ version: "2"
3
3
linters :
4
4
default : none
5
5
enable : # please keep this alphabetized
6
+ - depguard # Implement forbidden dependencies
6
7
- errorlint
7
8
- ineffassign
8
9
- nakedret
@@ -17,6 +18,47 @@ linters:
17
18
- usetesting
18
19
- whitespace
19
20
settings :
21
+ depguard :
22
+ rules :
23
+ api :
24
+ list-mode : lax
25
+ files :
26
+ - ' **/api/**/*.go'
27
+ - ' !**/server/etcdserver/api/**/*.go'
28
+ deny :
29
+ - pkg : go.etcd.io/etcd/api/v3$
30
+ - pkg : go.etcd.io/etcd/pkg/v3
31
+ - pkg : go.etcd.io/etcd/v3
32
+ - pkg : go.etcd.io/tests/v3
33
+ - pkg : go.etcd.io/v3
34
+ client :
35
+ list-mode : lax
36
+ files :
37
+ - " **/client/v3/**/*.go"
38
+ deny :
39
+ - pkg : go.etcd.io/etcd/pkg/v3
40
+ - pkg : go.etcd.io/etcd/v3
41
+ - pkg : go.etcd.io/tests/v3
42
+ cli-and-server :
43
+ list-mode : lax
44
+ files :
45
+ - " **/etcdctl/**/*.go"
46
+ - " **/etcdutl/**/*.go"
47
+ - " **/server/**/*.go"
48
+ - " !**/tests/antithesis/server/**/*.go"
49
+ deny :
50
+ - pkg : go.etcd.io/etcd/v3
51
+ - pkg : go.etcd.io/tests/v3
52
+ pkg :
53
+ list-mode : lax
54
+ files :
55
+ - " **/pkg/**/*.go"
56
+ - " !**/client/pkg/**/*.go"
57
+ - " !**/tools/rw-heatmaps/pkg/**/*.go"
58
+ deny :
59
+ - pkg : go.etcd.io/etcd/api/v3
60
+ - pkg : go.etcd.io/etcd/v3
61
+ - pkg : go.etcd.io/tests/v3
20
62
nakedret :
21
63
# Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10
22
64
max-func-lines : 5
You can’t perform that action at this time.
0 commit comments