Skip to content

Commit 4d04e40

Browse files
committed
chore: update implementation
1 parent 84caf39 commit 4d04e40

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.golangci.next.reference.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,9 @@ linters:
14531453
# Defines a pattern to validate `go` minimum version directive.
14541454
# Default: '' (no match)
14551455
go-version-pattern: '\d\.\d+(\.0)?'
1456+
# Check the validity of the module path.
1457+
# Default: false
1458+
check-module-path: true
14561459

14571460
gomodguard:
14581461
allowed:

jsonschema/golangci.next.jsonschema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2220,6 +2220,11 @@
22202220
"description": "Defines a pattern to validate `go` minimum version directive.",
22212221
"type": "string",
22222222
"default": ""
2223+
},
2224+
"check-module-path": {
2225+
"description": "Check the validity of the module path.",
2226+
"type": "boolean",
2227+
"default": false
22232228
}
22242229
}
22252230
},

pkg/config/linters_settings.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ type GoModDirectivesSettings struct {
575575
ToolForbidden bool `mapstructure:"tool-forbidden"`
576576
GoDebugForbidden bool `mapstructure:"go-debug-forbidden"`
577577
GoVersionPattern string `mapstructure:"go-version-pattern"`
578+
CheckModulePath bool `mapstructure:"check-module-path"`
578579
}
579580

580581
type GoModGuardSettings struct {

pkg/golinters/gomoddirectives/gomoddirectives.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func New(settings *config.GoModDirectivesSettings) *goanalysis.Linter {
2929
opts.ToolchainForbidden = settings.ToolchainForbidden
3030
opts.ToolForbidden = settings.ToolForbidden
3131
opts.GoDebugForbidden = settings.GoDebugForbidden
32+
opts.CheckModulePath = settings.CheckModulePath
3233

3334
if settings.ToolchainPattern != "" {
3435
exp, err := regexp.Compile(settings.ToolchainPattern)

0 commit comments

Comments
 (0)