File tree Expand file tree Collapse file tree 6 files changed +105
-4
lines changed Expand file tree Collapse file tree 6 files changed +105
-4
lines changed Original file line number Diff line number Diff line change
1
+ linters-settings :
2
+ gocritic :
3
+ disabled-checks :
4
+ - " paramTypeCombine"
5
+ enabled-tags :
6
+ - " performance"
7
+ - " style"
8
+ - " diagnostic"
9
+ linters :
10
+ enable :
11
+ - asasalint
12
+ - asciicheck
13
+ - bidichk
14
+ - bodyclose
15
+ - containedctx
16
+ - contextcheck
17
+ - cyclop
18
+ - decorder
19
+ - dogsled
20
+ - dupword
21
+ - durationcheck
22
+ - errcheck
23
+ - errname
24
+ - errorlint
25
+ - execinquery
26
+ - exhaustive
27
+ - exportloopref
28
+ - forbidigo
29
+ - ginkgolinter
30
+ - gocheckcompilerdirectives
31
+ - gochecknoinits
32
+ - gocognit
33
+ - goconst
34
+ - gocritic
35
+ - gocyclo
36
+ - goerr113
37
+ - gofmt
38
+ - gofumpt
39
+ - goheader
40
+ - goimports
41
+ - gomoddirectives
42
+ - gomodguard
43
+ - goprintffuncname
44
+ - gosec
45
+ - gosimple
46
+ - gosmopolitan
47
+ - govet
48
+ - grouper
49
+ - ifshort
50
+ - importas
51
+ - ineffassign
52
+ - interfacebloat
53
+ - interfacer
54
+ - ireturn
55
+ - loggercheck
56
+ - maintidx
57
+ - makezero
58
+ - mirror
59
+ - misspell
60
+ - musttag
61
+ - nakedret
62
+ - nestif
63
+ - nilerr
64
+ - nilnil
65
+ - nlreturn
66
+ - nonamedreturns
67
+ - nosprintfhostport
68
+ - paralleltest
69
+ - prealloc
70
+ - predeclared
71
+ - promlinter
72
+ - reassign
73
+ - rowserrcheck
74
+ - sqlclosecheck
75
+ - staticcheck
76
+ - tenv
77
+ - thelper
78
+ - tparallel
79
+ - typecheck
80
+ - unconvert
81
+ - unparam
82
+ - unused
83
+ - usestdlibvars
84
+ - wastedassign
85
+ - whitespace
86
+ - zerologlint
Original file line number Diff line number Diff line change @@ -12,4 +12,11 @@ test: fmt ## Run unit tests, alias: t
12
12
13
13
fmt : # # Format go code
14
14
@go mod tidy
15
- @go fmt ./...
15
+ @gofumpt -l -w .
16
+
17
+ tools : # # Install extra tools for development
18
+ go install mvdan.cc/gofumpt@latest
19
+ go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
20
+
21
+ lint : # # Lint the code locally
22
+ golangci-lint run --timeout 600s
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ func SettingOnly() Option {
35
35
36
36
// New creates a new instance of the plugin that can be registered in gorm. Without any settings, all queries will be
37
37
// LIKE-d.
38
+ //
39
+ //nolint:ireturn // Acceptable
38
40
func New (opts ... Option ) gorm.Plugin {
39
41
plugin := & gormLike {}
40
42
Original file line number Diff line number Diff line change 1
1
package gormlike
2
2
3
3
import (
4
+ "testing"
5
+
4
6
"github.com/ing-bank/gormtestutil"
5
7
"github.com/stretchr/testify/assert"
6
- "testing"
7
8
)
8
9
9
10
func TestDeepGorm_Name_ReturnsExpectedName (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -2,13 +2,15 @@ package gormlike
2
2
3
3
import (
4
4
"fmt"
5
+ "strings"
6
+
5
7
"gorm.io/gorm"
6
8
"gorm.io/gorm/clause"
7
- "strings"
8
9
)
9
10
10
11
const tagName = "gormlike"
11
12
13
+ //nolint:gocognit,cyclop // Acceptable
12
14
func (d * gormLike ) queryCallback (db * gorm.DB ) {
13
15
// If we only want to like queries that are explicitly set to true, we back out early if anything's amiss
14
16
settingValue , settingOk := db .Get (tagName )
@@ -110,6 +112,7 @@ func (d *gormLike) queryCallback(db *gorm.DB) {
110
112
111
113
if useOr {
112
114
query = query .Or (condition , value )
115
+
113
116
continue
114
117
}
115
118
Original file line number Diff line number Diff line change 1
1
package gormlike
2
2
3
3
import (
4
+ "testing"
5
+
4
6
"github.com/google/uuid"
5
7
"github.com/ing-bank/gormtestutil"
6
8
"github.com/stretchr/testify/assert"
7
9
"gorm.io/gorm"
8
- "testing"
9
10
)
10
11
12
+ // nolint:maintidx // Acceptable
11
13
func TestGormLike_Initialize_TriggersLikingCorrectly (t * testing.T ) {
12
14
t .Parallel ()
13
15
You can’t perform that action at this time.
0 commit comments