Skip to content

Commit 48d9a9a

Browse files
committed
chore: linting config
Signed-off-by: Frédéric BIDON <fredbi@yahoo.com>
1 parent 8a1cae1 commit 48d9a9a

3 files changed

Lines changed: 25 additions & 4 deletions

File tree

‎.golangci.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ linters:
99
- gomodguard
1010
- gomodguard_v2
1111
- exhaustruct
12+
- exhaustruct_v5
1213
- nlreturn
1314
- nonamedreturns
1415
- noinlineerr
@@ -28,10 +29,12 @@ linters:
2829
goconst:
2930
min-len: 2
3031
min-occurrences: 3
32+
gocognit:
33+
min-complexity: 35
3134
cyclop:
32-
max-complexity: 20
35+
max-complexity: 25
3336
gocyclo:
34-
min-complexity: 20
37+
min-complexity: 35
3538
exhaustive:
3639
default-signifies-exhaustive: true
3740
default-case-required: true

‎jsonname/name_provider.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ func NewNameProvider() *NameProvider {
3939
}
4040

4141
func buildnameIndex(tpe reflect.Type, idx, reverseIdx map[string]string) {
42-
for i := range tpe.NumField() {
43-
targetDes := tpe.Field(i)
42+
for targetDes := range tpe.Fields() {
43+
targetDes := targetDes
4444

4545
if targetDes.PkgPath != "" { // unexported
4646
continue

‎revive.toml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# revive configuration used by codefactor.io.
2+
#
3+
# This is redundant with .golangci.yml, since revive is part of golangci-lint,
4+
# but we need to configure it to remain consistent across reporting tools.
5+
6+
ignore-generated-header = false
7+
severity = "warning"
8+
confidence = 0.8
9+
error-code = 0
10+
warning-code = 0
11+
enable-default-rules = true
12+
13+
[rule.exported]
14+
disabled = true
15+
[rule.cyclomatic]
16+
arguments = [20]
17+
[rule.cognitive-complexity]
18+
arguments = [20]

0 commit comments

Comments
 (0)