Skip to content

Commit 0be5b7e

Browse files
committed
address review comments
1 parent 275ac4f commit 0be5b7e

File tree

6 files changed

+8
-27
lines changed

6 files changed

+8
-27
lines changed

.golangci.next.reference.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,10 +2020,6 @@ linters-settings:
20202020
# - "scope": report only if a context exists in the scope of the outermost function
20212021
# Default: ""
20222022
context: "all"
2023-
# Deprecated: use `context` instead.
2024-
# Enforce using methods that accept a context.
2025-
# Default: false
2026-
context-only: true
20272023
# Enforce using static values for log messages.
20282024
# Default: false
20292025
static-msg: true

.golangci.reference.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,14 +2013,6 @@ linters-settings:
20132013
# Default: ""
20142014
no-global: "all"
20152015
# Enforce using methods that accept a context.
2016-
# Values:
2017-
# - "": disabled
2018-
# - "all": report all contextless calls
2019-
# - "scope": report only if a context exists in the scope of the outermost function
2020-
# Default: ""
2021-
context: "all"
2022-
# Deprecated: use `context` instead.
2023-
# Enforce using methods that accept a context.
20242016
# Default: false
20252017
context-only: true
20262018
# Enforce using static values for log messages.

jsonschema/golangci.jsonschema.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,16 +2275,10 @@
22752275
"default": true
22762276
},
22772277
"context-only": {
2278-
"deprecated": true,
22792278
"description": "Enforce using methods that accept a context.",
22802279
"type": "boolean",
22812280
"default": false
22822281
},
2283-
"context": {
2284-
"description": "Enforce using methods that accept a context.",
2285-
"enum": ["", "all", "scope"],
2286-
"default": ""
2287-
},
22882282
"static-msg": {
22892283
"description": "Enforce using static values for log messages.",
22902284
"type": "boolean",

jsonschema/golangci.next.jsonschema.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,12 +2289,6 @@
22892289
"type": "boolean",
22902290
"default": true
22912291
},
2292-
"context-only": {
2293-
"deprecated": true,
2294-
"description": "Enforce using methods that accept a context.",
2295-
"type": "boolean",
2296-
"default": false
2297-
},
22982292
"context": {
22992293
"description": "Enforce using methods that accept a context.",
23002294
"enum": ["", "all", "scope"],

pkg/config/loader.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,14 @@ func (l *Loader) handleLinterOptionDeprecations() {
408408
if l.cfg.LintersSettings.Stylecheck.GoVersion != "" {
409409
l.log.Warnf("The configuration option `linters.stylecheck.go` is deprecated, please use global `run.go`.")
410410
}
411+
412+
// Deprecated since v1.58.0
413+
if l.cfg.LintersSettings.SlogLint.ContextOnly {
414+
l.log.Warnf("The configuration option `linters.sloglint.context-only` is deprecated, please use `linters.sloglint.context`")
415+
if l.cfg.LintersSettings.SlogLint.Context == "" {
416+
l.cfg.LintersSettings.SlogLint.Context = "all"
417+
}
418+
}
411419
}
412420

413421
func (l *Loader) handleEnableOnlyOption() error {

pkg/golinters/sloglint/sloglint.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ func New(settings *config.SlogLintSettings) *goanalysis.Linter {
2222
KeyNamingCase: settings.KeyNamingCase,
2323
ArgsOnSepLines: settings.ArgsOnSepLines,
2424
}
25-
if settings.ContextOnly && settings.Context == "" {
26-
opts.ContextOnly = "all"
27-
}
2825
}
2926

3027
a := sloglint.New(opts)

0 commit comments

Comments
 (0)