Skip to content

Commit c07c396

Browse files
committed
* fixed linter manually
1 parent e1fc30d commit c07c396

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+686
-320
lines changed

.golangci.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@ linters:
2020
- tr
2121
- tx
2222
- t
23-
- xtx
23+
- xTx
24+
- xTr
2425
- sp
2526
- in
2627
- s
28+
- xs
2729
- oo
30+
- fn
31+
- ok
2832
ignore-decls:
2933
- wg sync.WaitGroup
3034
- wg *sync.WaitGroup
3135
- db *gorm.DB
3236
- db redis.UniversalClient
33-
- m Manager
37+
- db *sql.DB
38+
- m *Manager
39+
- m trm.Manager
3440
wsl_v5:
3541
default: all
3642
disable:
@@ -92,6 +98,16 @@ linters:
9298
- wsl_v5
9399
text: 'missing whitespace above this line'
94100

101+
- path: 'trm/trm/context/'
102+
linters:
103+
- revive
104+
text: 'var-naming: avoid package names that conflict with Go standard library package names'
105+
106+
- path: 'trm/trm/internal/.+\.go'
107+
linters:
108+
- revive
109+
text: 'var-naming: avoid meaningless package names'
110+
95111
- path: '_test\.go'
96112
linters:
97113
- revive
@@ -121,6 +137,16 @@ linters:
121137
- ireturn
122138
source: '\) Begin\(ctx'
123139

140+
- path: '(.+/)?xsettings\.go'
141+
linters:
142+
- ireturn
143+
source: 'func DefaultXSettings\('
144+
145+
- path: '(.+/)?xsettings\.go'
146+
linters:
147+
- ireturn
148+
source: 'func NewXSettings\('
149+
124150
- path: '(.+/)?settings\.go'
125151
linters:
126152
- ireturn
@@ -130,6 +156,18 @@ linters:
130156
- gochecknoglobals
131157
source: 'DefaultCtxGetter'
132158

159+
160+
- path: 'trm/trm/drivers/mock'
161+
text: ' package has more than one godoc ("mock")'
162+
linters:
163+
- godoclint
164+
165+
- path: '_test\.go'
166+
source: 'do: func\('
167+
text: 'test helper function should start from t.Helper()'
168+
linters:
169+
- thelper
170+
133171
- path: '_test\.go'
134172
source: 'prepare: func\('
135173
text: 'test helper function should start from t.Helper()'
@@ -166,8 +204,14 @@ linters:
166204
formatters:
167205
enable:
168206
- gofmt
207+
- gci
169208
- gofumpt
170209
- goimports
210+
- golines
211+
settings:
212+
goimports:
213+
local-prefixes:
214+
- github.com/avito-tech/go-transaction-manager/trm/v2
171215

172216
exclusions:
173217
paths:

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ fmt:
2323
lint:
2424
cd sh && sh ./lint.sh
2525

26+
lint-with-fix:
27+
cd sh && sh ./lint.sh --fix
28+
2629
lint.verbose:
2730
cd sh && sh ./lint.sh -v
2831

drivers/goredis8/context.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ package goredis8
33
import (
44
"context"
55

6-
"github.com/go-redis/redis/v8"
7-
86
"github.com/avito-tech/go-transaction-manager/trm/v2"
97
trmcontext "github.com/avito-tech/go-transaction-manager/trm/v2/context"
8+
"github.com/go-redis/redis/v8"
109
)
1110

1211
// DefaultCtxGetter is the CtxGetter with settings.DefaultCtxKey.

drivers/goredis8/factory.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ package goredis8
33
import (
44
"context"
55

6-
"github.com/go-redis/redis/v8"
7-
86
"github.com/avito-tech/go-transaction-manager/trm/v2"
7+
"github.com/go-redis/redis/v8"
98
)
109

1110
// NewDefaultFactory creates default trm.Transaction(redis.UniversalClient).

0 commit comments

Comments
 (0)