Skip to content

Commit 1d546be

Browse files
committed
Enforce no dependencies with depguard
1 parent c05ebc5 commit 1d546be

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

.golangci.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,43 @@
1-
run:
2-
# Timeout for analysis, e.g. 30s, 5m.
3-
# Default: 1m
4-
timeout: 3m
1+
run: { timeout: 3m }
52

63
linters-settings:
74
cyclop:
8-
# The maximal code complexity to report.
9-
# Default: 10
105
max-complexity: 15
11-
# The maximal average package complexity.
12-
# If it's higher than 0.0 (float) the check is enabled
13-
# Default: 0.0
146
package-average: 0.5
15-
# Should ignore tests.
16-
# Default: false
177
skip-tests: false
188

199
govet:
20-
# Report about shadowed variables.
21-
# Default: false
2210
check-shadowing: true
23-
# Enable all analyzers.
2411
enable-all: true
2512

26-
misspell:
27-
# Correct spellings using locale preferences for US or UK.
28-
# Setting locale to US will correct the British spelling of 'colour' to 'color'.
29-
# Default is to use a neutral variety of English.
30-
locale: US
13+
misspell: { locale: US }
14+
15+
depguard:
16+
rules:
17+
main: { allow: ["$gostd", "github.com/BooleanCat/go-functional"] }
3118

3219
linters:
33-
# Disable all linters.
34-
# Default: false
3520
disable-all: true
36-
# Enable specific linter
37-
# https://golangci-lint.run/usage/linters/#enabled-by-default
3821
enable:
39-
# Default
4022
- errcheck
4123
- gosimple
4224
- govet
4325
- ineffassign
4426
- staticcheck
4527
- unused
46-
# Other linters for report card
28+
- asasalint
29+
- asciicheck
30+
- bidichk
31+
- decorder
32+
- depguard
33+
- durationcheck
34+
- errchkjson
35+
- errorlint
36+
- exhaustive
37+
- gochecknoglobals
38+
- gocritic
39+
- gosec
40+
- nilerr
4741
- gofmt
4842
- gocyclo
4943
- misspell

iter/iter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func TestFold(t *testing.T) {
115115
func TestToChannel(t *testing.T) {
116116
expected := 0
117117
for number := range iter.ToChannel[int](iter.Lift([]int{1, 2, 3, 4})) {
118-
expected += 1
118+
expected++
119119
assert.Equal(t, number, expected)
120120
}
121121
}
@@ -205,7 +205,7 @@ func TestBaseIteratorChain(t *testing.T) {
205205
func TestBaseIteratorToChannel(t *testing.T) {
206206
expected := 0
207207
for number := range iter.Lift([]int{1, 2, 3, 4}).ToChannel() {
208-
expected += 1
208+
expected++
209209
assert.Equal(t, number, expected)
210210
}
211211
}

iter/take.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (iter *TakeIter[T]) Next() option.Option[T] {
2727
if next.IsNone() {
2828
iter.limit = 0
2929
} else {
30-
iter.limit -= 1
30+
iter.limit--
3131
}
3232

3333
return next

0 commit comments

Comments
 (0)