dev: clean deprecated options (#4673)
This commit is contained in:
parent
55b2f5ddeb
commit
dfde3797d5
@ -279,23 +279,11 @@ linters-settings:
|
||||
# Default: false
|
||||
check-blank: true
|
||||
|
||||
# DEPRECATED comma-separated list of pairs of the form pkg:regex
|
||||
#
|
||||
# the regex is used to ignore names within pkg. (default "fmt:.*").
|
||||
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
|
||||
ignore: fmt:.*,io/ioutil:^Read.*
|
||||
|
||||
# To disable the errcheck built-in exclude list.
|
||||
# See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details.
|
||||
# Default: false
|
||||
disable-default-exclusions: true
|
||||
|
||||
# DEPRECATED use exclude-functions instead.
|
||||
#
|
||||
# Path to a file containing a list of functions to exclude from checking.
|
||||
# See https://github.com/kisielk/errcheck#excluding-functions for details.
|
||||
exclude: /path/to/file.txt
|
||||
|
||||
# List of functions to exclude from checking, where each entry is a single function to exclude.
|
||||
# See https://github.com/kisielk/errcheck#excluding-functions for details.
|
||||
exclude-functions:
|
||||
@ -431,9 +419,6 @@ linters-settings:
|
||||
ignore-comments: true
|
||||
|
||||
gci:
|
||||
# DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.
|
||||
local-prefixes: github.com/org/project
|
||||
|
||||
# Section configuration to compare against.
|
||||
# Section names are case-insensitive and may contain parameters in ().
|
||||
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
|
||||
@ -637,9 +622,6 @@ linters-settings:
|
||||
# The option is passed to the ruleguard 'debug-group' argument.
|
||||
# Default: ""
|
||||
debug: 'emptyDecl'
|
||||
# Deprecated, use 'failOn' param.
|
||||
# If set to true, identical to failOn='all', otherwise failOn=''
|
||||
failOnError: false
|
||||
# Determines the behavior when an error occurs while parsing ruleguard files.
|
||||
# If flag is not set, log error and skip rule files that contain an error.
|
||||
# If flag is set, the value must be a comma-separated list of error conditions.
|
||||
@ -647,7 +629,7 @@ linters-settings:
|
||||
# - 'import': ruleguard rule imports a package that cannot be found.
|
||||
# - 'dsl': gorule file does not comply with the ruleguard DSL.
|
||||
# Default: ""
|
||||
failOn: dsl
|
||||
failOn: dsl,import
|
||||
# Comma-separated list of file paths containing ruleguard rules.
|
||||
# If a path is relative, it is relative to the directory where the golangci-lint command is executed.
|
||||
# The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file.
|
||||
@ -724,9 +706,6 @@ linters-settings:
|
||||
replacement: 'a[b:]'
|
||||
|
||||
gofumpt:
|
||||
# Deprecated: use the global `run.go` instead.
|
||||
lang-version: "1.17"
|
||||
|
||||
# Module path which contains the source code being formatted.
|
||||
# Default: ""
|
||||
module-path: github.com/org/project
|
||||
@ -830,8 +809,6 @@ linters-settings:
|
||||
local_replace_directives: false
|
||||
|
||||
gosimple:
|
||||
# Deprecated: use the global `run.go` instead.
|
||||
go: "1.15"
|
||||
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||
# Default: ["*"]
|
||||
checks: [ "all" ]
|
||||
@ -2059,15 +2036,11 @@ linters-settings:
|
||||
extra-start-span-signatures:
|
||||
- "github.com/user/repo/telemetry/trace.Start:opentelemetry"
|
||||
staticcheck:
|
||||
# Deprecated: use the global `run.go` instead.
|
||||
go: "1.15"
|
||||
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||
# Default: ["*"]
|
||||
checks: [ "all" ]
|
||||
|
||||
stylecheck:
|
||||
# Deprecated: use the global `run.go` instead.
|
||||
go: "1.15"
|
||||
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
|
||||
# Default: ["*"]
|
||||
checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
|
||||
@ -2291,9 +2264,6 @@ linters-settings:
|
||||
# Suggest the use of rpc.DefaultXXPath.
|
||||
# Default: false
|
||||
default-rpc-path: true
|
||||
# DEPRECATED Suggest the use of os.DevNull.
|
||||
# Default: false
|
||||
os-dev-null: true
|
||||
# Suggest the use of sql.LevelXX.String().
|
||||
# Default: false
|
||||
sql-isolation-level: true
|
||||
@ -2303,9 +2273,6 @@ linters-settings:
|
||||
# Suggest the use of constant.Kind.String().
|
||||
# Default: false
|
||||
constant-kind: true
|
||||
# DEPRECATED Suggest the use of syslog.Priority.
|
||||
# Default: false
|
||||
syslog-priority: true
|
||||
|
||||
unconvert:
|
||||
# Remove conversions that force intermediate rounding.
|
||||
|
@ -750,16 +750,6 @@
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"ignore": {
|
||||
"description": "DEPRECATED: use `exclude-functions` instead. Comma-separated list of pairs of the form \"pkg:regex\".",
|
||||
"type": "string",
|
||||
"default": "fmt:.*"
|
||||
},
|
||||
"exclude": {
|
||||
"description": "DEPRECATED: use `exclude-functions` instead. Path to a file containing a list of functions to exclude from checking.",
|
||||
"type": "string",
|
||||
"examples": ["/path/to/file.txt"]
|
||||
},
|
||||
"exclude-functions": {
|
||||
"description": "List of functions to exclude from checking, where each entry is a single function to exclude",
|
||||
"type": "array",
|
||||
@ -962,11 +952,6 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"local-prefixes": {
|
||||
"description": "DEPRECATED: use 'sections' and 'prefix(github.com/org/project)' instead.",
|
||||
"type": "string",
|
||||
"examples": ["github.com/org/project"]
|
||||
},
|
||||
"sections": {
|
||||
"description": "Section configuration to compare against.",
|
||||
"type": "array",
|
||||
@ -1159,8 +1144,157 @@
|
||||
"settings": {
|
||||
"description": "Settings passed to gocritic. Properties must be valid and enabled check names.",
|
||||
"type": "object",
|
||||
"propertyNames": {
|
||||
"$ref": "#/definitions/gocritic-checks"
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"captLocal": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"paramsOnly" : {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"commentedOutCode": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"minLength" : {
|
||||
"type": "number",
|
||||
"default": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
"elseif": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"skipBalanced" : {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"hugeParam": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"sizeThreshold" : {
|
||||
"type": "number",
|
||||
"default": 80
|
||||
}
|
||||
}
|
||||
},
|
||||
"ifElseChain": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"minThreshold" : {
|
||||
"type": "number",
|
||||
"default": 2
|
||||
}
|
||||
}
|
||||
},
|
||||
"nestingReduce": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"bodyWidth" : {
|
||||
"type": "number",
|
||||
"default": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"rangeExprCopy": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"sizeThreshold" : {
|
||||
"type": "number",
|
||||
"default": 512
|
||||
},
|
||||
"skipTestFuncs" : {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"rangeValCopy": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"sizeThreshold" : {
|
||||
"type": "number",
|
||||
"default": 128
|
||||
},
|
||||
"skipTestFuncs" : {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"ruleguard": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"debug" : {
|
||||
"type": "string"
|
||||
},
|
||||
"enable" : {
|
||||
"type": "string"
|
||||
},
|
||||
"disable" : {
|
||||
"type": "string"
|
||||
},
|
||||
"failOn" : {
|
||||
"type": "string"
|
||||
},
|
||||
"rules" : {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tooManyResultsChecker": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"maxResults" : {
|
||||
"type": "number",
|
||||
"default": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
"truncateCmp": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"skipArchDependent" : {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"underef": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"skipRecvDeref" : {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"unnamedResult": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"checkExported" : {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"disable-all": {
|
||||
@ -1277,11 +1411,6 @@
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"lang-version": {
|
||||
"description": "Select the Go version to target.",
|
||||
"type": "string",
|
||||
"default": "1.15"
|
||||
},
|
||||
"module-path": {
|
||||
"description": " Module path which contains the source code being formatted.",
|
||||
"type": "string"
|
||||
@ -1481,11 +1610,6 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"go": {
|
||||
"description": "Targeted Go version",
|
||||
"type": "string",
|
||||
"default": "1.13"
|
||||
},
|
||||
"checks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -2352,11 +2476,6 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"go": {
|
||||
"description": "Targeted Go version",
|
||||
"type": "string",
|
||||
"default": "1.13"
|
||||
},
|
||||
"checks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -2376,11 +2495,6 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"go": {
|
||||
"description": "Targeted Go version",
|
||||
"type": "string",
|
||||
"default": "1.13"
|
||||
},
|
||||
"checks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@ -2878,11 +2992,6 @@
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"os-dev-null": {
|
||||
"description": "Suggest the use of os.DevNull.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"sql-isolation-level": {
|
||||
"description": "Suggest the use of sql.LevelXX.String().",
|
||||
"type": "boolean",
|
||||
@ -2897,11 +3006,6 @@
|
||||
"description": "Suggest the use of constant.Kind.String().",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"syslog-priority": {
|
||||
"description": "Suggest the use of syslog.Priority.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -909,11 +909,11 @@ type UseStdlibVarsSettings struct {
|
||||
TimeLayout bool `mapstructure:"time-layout"`
|
||||
CryptoHash bool `mapstructure:"crypto-hash"`
|
||||
DefaultRPCPath bool `mapstructure:"default-rpc-path"`
|
||||
OSDevNull bool `mapstructure:"os-dev-null"`
|
||||
OSDevNull bool `mapstructure:"os-dev-null"` // Deprecated
|
||||
SQLIsolationLevel bool `mapstructure:"sql-isolation-level"`
|
||||
TLSSignatureScheme bool `mapstructure:"tls-signature-scheme"`
|
||||
ConstantKind bool `mapstructure:"constant-kind"`
|
||||
SyslogPriority bool `mapstructure:"syslog-priority"`
|
||||
SyslogPriority bool `mapstructure:"syslog-priority"` // Deprecated
|
||||
}
|
||||
|
||||
type UnconvertSettings struct {
|
||||
|
@ -411,11 +411,21 @@ func (l *Loader) handleLinterOptionDeprecations() {
|
||||
|
||||
// Deprecated since v1.58.0
|
||||
if l.cfg.LintersSettings.SlogLint.ContextOnly {
|
||||
l.log.Warnf("The configuration option `linters.sloglint.context-only` is deprecated, please use `linters.sloglint.context`")
|
||||
l.log.Warnf("The configuration option `linters.sloglint.context-only` is deprecated, please use `linters.sloglint.context`.")
|
||||
if l.cfg.LintersSettings.SlogLint.Context == "" {
|
||||
l.cfg.LintersSettings.SlogLint.Context = "all"
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated since v1.51.0
|
||||
if l.cfg.LintersSettings.UseStdlibVars.OSDevNull {
|
||||
l.log.Warnf("The configuration option `linters.usestdlibvars.os-dev-null` is deprecated.")
|
||||
}
|
||||
|
||||
// Deprecated since v1.51.0
|
||||
if l.cfg.LintersSettings.UseStdlibVars.SyslogPriority {
|
||||
l.log.Warnf("The configuration option `linters.usestdlibvars.syslog-priority` is deprecated.")
|
||||
}
|
||||
}
|
||||
|
||||
func (l *Loader) handleEnableOnlyOption() error {
|
||||
|
@ -1,17 +0,0 @@
|
||||
//golangcitest:args -Eerrcheck
|
||||
//golangcitest:config_path testdata/errcheck_exclude.yml
|
||||
package testdata
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
func TestErrcheckExclude() []byte {
|
||||
ret, _ := ioutil.ReadFile("f.txt")
|
||||
return ret
|
||||
}
|
||||
|
||||
func TestErrcheckNoExclude() []byte {
|
||||
ret, _ := ioutil.ReadAll(nil) // want "Error return value of `ioutil.ReadAll` is not checked"
|
||||
return ret
|
||||
}
|
@ -1 +0,0 @@
|
||||
io/ioutil.ReadFile
|
@ -1,4 +0,0 @@
|
||||
linters-settings:
|
||||
errcheck:
|
||||
check-blank: true
|
||||
exclude: errcheck_exclude.txt
|
@ -1,28 +0,0 @@
|
||||
//golangcitest:args -Eerrcheck
|
||||
//golangcitest:config_path testdata/errcheck_ignore_config.yml
|
||||
package testdata
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
func TestErrcheckIgnoreOs() {
|
||||
_, _ = os.Open("f.txt")
|
||||
}
|
||||
|
||||
func TestErrcheckIgnoreFmt(s string) int {
|
||||
n, _ := fmt.Println(s)
|
||||
return n
|
||||
}
|
||||
|
||||
func TestErrcheckIgnoreIoutil() []byte {
|
||||
ret, _ := ioutil.ReadFile("f.txt")
|
||||
return ret
|
||||
}
|
||||
|
||||
func TestErrcheckNoIgnoreIoutil() []byte {
|
||||
ret, _ := ioutil.ReadAll(nil) // want "Error return value of `ioutil.ReadAll` is not checked"
|
||||
return ret
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
linters-settings:
|
||||
errcheck:
|
||||
check-blank: true
|
||||
ignore: os:.*,io/ioutil:^ReadF.*
|
||||
issues:
|
||||
include:
|
||||
- EXC0001
|
Loading…
x
Reference in New Issue
Block a user