Skip to content

Commit 67825fe

Browse files
build(deps): bump github.com/ldez/gomoddirectives from 0.5.0 to 0.6.0 (#5196)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent fc650e4 commit 67825fe

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

.golangci.next.reference.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,9 @@ linters-settings:
13691369
# Forbid the use of the `toolchain` directive.
13701370
# Default: false
13711371
toolchain-forbidden: true
1372+
# Defines a pattern to validate `toolchain` directive.
1373+
# Default: '' (no match)
1374+
toolchain-pattern: 'go1\.23\.\d+$'
13721375
# Forbid the use of the `tool` directives.
13731376
# Default: false
13741377
tool-forbidden: true

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ require (
6666
github.com/kunwardeep/paralleltest v1.0.10
6767
github.com/kyoh86/exportloopref v0.1.11
6868
github.com/lasiar/canonicalheader v1.1.2
69-
github.com/ldez/gomoddirectives v0.5.0
69+
github.com/ldez/gomoddirectives v0.6.0
7070
github.com/ldez/grignotin v0.6.0
7171
github.com/ldez/tagliatelle v0.6.0
7272
github.com/ldez/usetesting v0.2.2

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.next.jsonschema.json

+4
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,10 @@
16801680
"type": "boolean",
16811681
"default": false
16821682
},
1683+
"toolchain-pattern": {
1684+
"description": "Defines a pattern to validate `toolchain` directive.",
1685+
"type": "string"
1686+
},
16831687
"tool-forbidden": {
16841688
"description": "Forbid the use of the `tool` directives.",
16851689
"type": "boolean",

pkg/config/linters_settings.go

+1
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ type GoModDirectivesSettings struct {
586586
ExcludeForbidden bool `mapstructure:"exclude-forbidden"`
587587
RetractAllowNoExplanation bool `mapstructure:"retract-allow-no-explanation"`
588588
ToolchainForbidden bool `mapstructure:"toolchain-forbidden"`
589+
ToolchainPattern string `mapstructure:"toolchain-pattern"`
589590
ToolForbidden bool `mapstructure:"tool-forbidden"`
590591
GoDebugForbidden bool `mapstructure:"go-debug-forbidden"`
591592
GoVersionPattern string `mapstructure:"go-version-pattern"`

pkg/golinters/gomoddirectives/gomoddirectives.go

+9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ func New(settings *config.GoModDirectivesSettings) *goanalysis.Linter {
3030
opts.ToolForbidden = settings.ToolForbidden
3131
opts.GoDebugForbidden = settings.GoDebugForbidden
3232

33+
if settings.ToolchainPattern != "" {
34+
exp, err := regexp.Compile(settings.ToolchainPattern)
35+
if err != nil {
36+
internal.LinterLogger.Fatalf("%s: invalid toolchain pattern: %v", linterName, err)
37+
} else {
38+
opts.ToolchainPattern = exp
39+
}
40+
}
41+
3342
if settings.GoVersionPattern != "" {
3443
exp, err := regexp.Compile(settings.GoVersionPattern)
3544
if err != nil {

0 commit comments

Comments
 (0)