Skip to content

Commit 2712496

Browse files
committed
chore: update implementation
1 parent 2094f9e commit 2712496

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

.golangci.next.reference.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,9 @@ linters-settings:
670670
# Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed.
671671
# Default: true
672672
default-signifies-exhaustive: false
673+
# Include shared interfaces in the exhaustiviness check.
674+
# Default: false
675+
include-shared-interfaces: true
673676

674677
gocognit:
675678
# Minimal code complexity to report.

jsonschema/golangci.next.jsonschema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,11 @@
12161216
"description": "Presence of `default` case in switch statements satisfies exhaustiveness, if all members are not listed.",
12171217
"type": "boolean",
12181218
"default": true
1219+
},
1220+
"include-shared-interfaces": {
1221+
"description": "Include shared interfaces in the exhaustiviness check.",
1222+
"type": "boolean",
1223+
"default": false
12191224
}
12201225
}
12211226
},

pkg/config/linters_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ type GinkgoLinterSettings struct {
505505

506506
type GoChecksumTypeSettings struct {
507507
DefaultSignifiesExhaustive bool `mapstructure:"default-signifies-exhaustive"`
508+
IncludeSharedInterfaces bool `mapstructure:"include-shared-interfaces"`
508509
}
509510

510511
type GocognitSettings struct {

pkg/golinters/gochecksumtype/gochecksumtype.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ func runGoCheckSumType(pass *analysis.Pass, settings *config.GoChecksumTypeSetti
6161
TypesInfo: pass.TypesInfo,
6262
}
6363

64+
cfg := gochecksumtype.Config{
65+
DefaultSignifiesExhaustive: settings.DefaultSignifiesExhaustive,
66+
IncludeSharedInterfaces: settings.IncludeSharedInterfaces,
67+
}
68+
6469
var unknownError error
65-
errors := gochecksumtype.Run([]*packages.Package{pkg},
66-
gochecksumtype.Config{DefaultSignifiesExhaustive: settings.DefaultSignifiesExhaustive})
70+
errors := gochecksumtype.Run([]*packages.Package{pkg}, cfg)
6771
for _, err := range errors {
6872
err, ok := err.(gochecksumtype.Error)
6973
if !ok {

0 commit comments

Comments
 (0)