Skip to content

Commit dfde379

Browse files
authored
dev: clean deprecated options (#4673)
1 parent 55b2f5d commit dfde379

9 files changed

+165
-141
lines changed

.golangci.next.reference.yml

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -279,23 +279,11 @@ linters-settings:
279279
# Default: false
280280
check-blank: true
281281

282-
# DEPRECATED comma-separated list of pairs of the form pkg:regex
283-
#
284-
# the regex is used to ignore names within pkg. (default "fmt:.*").
285-
# see https://github.com/kisielk/errcheck#the-deprecated-method for details
286-
ignore: fmt:.*,io/ioutil:^Read.*
287-
288282
# To disable the errcheck built-in exclude list.
289283
# See `-excludeonly` option in https://github.com/kisielk/errcheck#excluding-functions for details.
290284
# Default: false
291285
disable-default-exclusions: true
292286

293-
# DEPRECATED use exclude-functions instead.
294-
#
295-
# Path to a file containing a list of functions to exclude from checking.
296-
# See https://github.com/kisielk/errcheck#excluding-functions for details.
297-
exclude: /path/to/file.txt
298-
299287
# List of functions to exclude from checking, where each entry is a single function to exclude.
300288
# See https://github.com/kisielk/errcheck#excluding-functions for details.
301289
exclude-functions:
@@ -431,9 +419,6 @@ linters-settings:
431419
ignore-comments: true
432420

433421
gci:
434-
# DEPRECATED: use `sections` and `prefix(github.com/org/project)` instead.
435-
local-prefixes: github.com/org/project
436-
437422
# Section configuration to compare against.
438423
# Section names are case-insensitive and may contain parameters in ().
439424
# The default order of sections is `standard > default > custom > blank > dot > alias > localmodule`,
@@ -637,17 +622,14 @@ linters-settings:
637622
# The option is passed to the ruleguard 'debug-group' argument.
638623
# Default: ""
639624
debug: 'emptyDecl'
640-
# Deprecated, use 'failOn' param.
641-
# If set to true, identical to failOn='all', otherwise failOn=''
642-
failOnError: false
643625
# Determines the behavior when an error occurs while parsing ruleguard files.
644626
# If flag is not set, log error and skip rule files that contain an error.
645627
# If flag is set, the value must be a comma-separated list of error conditions.
646628
# - 'all': fail on all errors.
647629
# - 'import': ruleguard rule imports a package that cannot be found.
648630
# - 'dsl': gorule file does not comply with the ruleguard DSL.
649631
# Default: ""
650-
failOn: dsl
632+
failOn: dsl,import
651633
# Comma-separated list of file paths containing ruleguard rules.
652634
# If a path is relative, it is relative to the directory where the golangci-lint command is executed.
653635
# The special '${configDir}' variable is substituted with the absolute directory containing the golangci config file.
@@ -724,9 +706,6 @@ linters-settings:
724706
replacement: 'a[b:]'
725707

726708
gofumpt:
727-
# Deprecated: use the global `run.go` instead.
728-
lang-version: "1.17"
729-
730709
# Module path which contains the source code being formatted.
731710
# Default: ""
732711
module-path: github.com/org/project
@@ -830,8 +809,6 @@ linters-settings:
830809
local_replace_directives: false
831810

832811
gosimple:
833-
# Deprecated: use the global `run.go` instead.
834-
go: "1.15"
835812
# Sxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
836813
# Default: ["*"]
837814
checks: [ "all" ]
@@ -2059,15 +2036,11 @@ linters-settings:
20592036
extra-start-span-signatures:
20602037
- "github.com/user/repo/telemetry/trace.Start:opentelemetry"
20612038
staticcheck:
2062-
# Deprecated: use the global `run.go` instead.
2063-
go: "1.15"
20642039
# SAxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
20652040
# Default: ["*"]
20662041
checks: [ "all" ]
20672042

20682043
stylecheck:
2069-
# Deprecated: use the global `run.go` instead.
2070-
go: "1.15"
20712044
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
20722045
# Default: ["*"]
20732046
checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]
@@ -2291,9 +2264,6 @@ linters-settings:
22912264
# Suggest the use of rpc.DefaultXXPath.
22922265
# Default: false
22932266
default-rpc-path: true
2294-
# DEPRECATED Suggest the use of os.DevNull.
2295-
# Default: false
2296-
os-dev-null: true
22972267
# Suggest the use of sql.LevelXX.String().
22982268
# Default: false
22992269
sql-isolation-level: true
@@ -2303,9 +2273,6 @@ linters-settings:
23032273
# Suggest the use of constant.Kind.String().
23042274
# Default: false
23052275
constant-kind: true
2306-
# DEPRECATED Suggest the use of syslog.Priority.
2307-
# Default: false
2308-
syslog-priority: true
23092276

23102277
unconvert:
23112278
# Remove conversions that force intermediate rounding.

jsonschema/golangci.next.jsonschema.json

Lines changed: 151 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -750,16 +750,6 @@
750750
"type": "boolean",
751751
"default": false
752752
},
753-
"ignore": {
754-
"description": "DEPRECATED: use `exclude-functions` instead. Comma-separated list of pairs of the form \"pkg:regex\".",
755-
"type": "string",
756-
"default": "fmt:.*"
757-
},
758-
"exclude": {
759-
"description": "DEPRECATED: use `exclude-functions` instead. Path to a file containing a list of functions to exclude from checking.",
760-
"type": "string",
761-
"examples": ["/path/to/file.txt"]
762-
},
763753
"exclude-functions": {
764754
"description": "List of functions to exclude from checking, where each entry is a single function to exclude",
765755
"type": "array",
@@ -962,11 +952,6 @@
962952
"type": "object",
963953
"additionalProperties": false,
964954
"properties": {
965-
"local-prefixes": {
966-
"description": "DEPRECATED: use 'sections' and 'prefix(github.com/org/project)' instead.",
967-
"type": "string",
968-
"examples": ["github.com/org/project"]
969-
},
970955
"sections": {
971956
"description": "Section configuration to compare against.",
972957
"type": "array",
@@ -1159,8 +1144,157 @@
11591144
"settings": {
11601145
"description": "Settings passed to gocritic. Properties must be valid and enabled check names.",
11611146
"type": "object",
1162-
"propertyNames": {
1163-
"$ref": "#/definitions/gocritic-checks"
1147+
"additionalProperties": false,
1148+
"properties": {
1149+
"captLocal": {
1150+
"type": "object",
1151+
"additionalProperties": false,
1152+
"properties": {
1153+
"paramsOnly" : {
1154+
"type": "boolean",
1155+
"default": true
1156+
}
1157+
}
1158+
},
1159+
"commentedOutCode": {
1160+
"type": "object",
1161+
"additionalProperties": false,
1162+
"properties": {
1163+
"minLength" : {
1164+
"type": "number",
1165+
"default": 15
1166+
}
1167+
}
1168+
},
1169+
"elseif": {
1170+
"type": "object",
1171+
"additionalProperties": false,
1172+
"properties": {
1173+
"skipBalanced" : {
1174+
"type": "boolean",
1175+
"default": true
1176+
}
1177+
}
1178+
},
1179+
"hugeParam": {
1180+
"type": "object",
1181+
"additionalProperties": false,
1182+
"properties": {
1183+
"sizeThreshold" : {
1184+
"type": "number",
1185+
"default": 80
1186+
}
1187+
}
1188+
},
1189+
"ifElseChain": {
1190+
"type": "object",
1191+
"additionalProperties": false,
1192+
"properties": {
1193+
"minThreshold" : {
1194+
"type": "number",
1195+
"default": 2
1196+
}
1197+
}
1198+
},
1199+
"nestingReduce": {
1200+
"type": "object",
1201+
"additionalProperties": false,
1202+
"properties": {
1203+
"bodyWidth" : {
1204+
"type": "number",
1205+
"default": 5
1206+
}
1207+
}
1208+
},
1209+
"rangeExprCopy": {
1210+
"type": "object",
1211+
"additionalProperties": false,
1212+
"properties": {
1213+
"sizeThreshold" : {
1214+
"type": "number",
1215+
"default": 512
1216+
},
1217+
"skipTestFuncs" : {
1218+
"type": "boolean",
1219+
"default": true
1220+
}
1221+
}
1222+
},
1223+
"rangeValCopy": {
1224+
"type": "object",
1225+
"additionalProperties": false,
1226+
"properties": {
1227+
"sizeThreshold" : {
1228+
"type": "number",
1229+
"default": 128
1230+
},
1231+
"skipTestFuncs" : {
1232+
"type": "boolean",
1233+
"default": true
1234+
}
1235+
}
1236+
},
1237+
"ruleguard": {
1238+
"type": "object",
1239+
"additionalProperties": false,
1240+
"properties": {
1241+
"debug" : {
1242+
"type": "string"
1243+
},
1244+
"enable" : {
1245+
"type": "string"
1246+
},
1247+
"disable" : {
1248+
"type": "string"
1249+
},
1250+
"failOn" : {
1251+
"type": "string"
1252+
},
1253+
"rules" : {
1254+
"type": "string"
1255+
}
1256+
}
1257+
},
1258+
"tooManyResultsChecker": {
1259+
"type": "object",
1260+
"additionalProperties": false,
1261+
"properties": {
1262+
"maxResults" : {
1263+
"type": "number",
1264+
"default": 5
1265+
}
1266+
}
1267+
},
1268+
"truncateCmp": {
1269+
"type": "object",
1270+
"additionalProperties": false,
1271+
"properties": {
1272+
"skipArchDependent" : {
1273+
"type": "boolean",
1274+
"default": true
1275+
}
1276+
}
1277+
},
1278+
"underef": {
1279+
"type": "object",
1280+
"additionalProperties": false,
1281+
"properties": {
1282+
"skipRecvDeref" : {
1283+
"type": "boolean",
1284+
"default": true
1285+
}
1286+
}
1287+
},
1288+
"unnamedResult": {
1289+
"type": "object",
1290+
"additionalProperties": false,
1291+
"properties": {
1292+
"checkExported" : {
1293+
"type": "boolean",
1294+
"default": false
1295+
}
1296+
}
1297+
}
11641298
}
11651299
},
11661300
"disable-all": {
@@ -1277,11 +1411,6 @@
12771411
"type": "boolean",
12781412
"default": false
12791413
},
1280-
"lang-version": {
1281-
"description": "Select the Go version to target.",
1282-
"type": "string",
1283-
"default": "1.15"
1284-
},
12851414
"module-path": {
12861415
"description": " Module path which contains the source code being formatted.",
12871416
"type": "string"
@@ -1481,11 +1610,6 @@
14811610
"type": "object",
14821611
"additionalProperties": false,
14831612
"properties": {
1484-
"go": {
1485-
"description": "Targeted Go version",
1486-
"type": "string",
1487-
"default": "1.13"
1488-
},
14891613
"checks": {
14901614
"type": "array",
14911615
"items": {
@@ -2352,11 +2476,6 @@
23522476
"type": "object",
23532477
"additionalProperties": false,
23542478
"properties": {
2355-
"go": {
2356-
"description": "Targeted Go version",
2357-
"type": "string",
2358-
"default": "1.13"
2359-
},
23602479
"checks": {
23612480
"type": "array",
23622481
"items": {
@@ -2376,11 +2495,6 @@
23762495
"type": "object",
23772496
"additionalProperties": false,
23782497
"properties": {
2379-
"go": {
2380-
"description": "Targeted Go version",
2381-
"type": "string",
2382-
"default": "1.13"
2383-
},
23842498
"checks": {
23852499
"type": "array",
23862500
"items": {
@@ -2878,11 +2992,6 @@
28782992
"type": "boolean",
28792993
"default": false
28802994
},
2881-
"os-dev-null": {
2882-
"description": "Suggest the use of os.DevNull.",
2883-
"type": "boolean",
2884-
"default": false
2885-
},
28862995
"sql-isolation-level": {
28872996
"description": "Suggest the use of sql.LevelXX.String().",
28882997
"type": "boolean",
@@ -2897,11 +3006,6 @@
28973006
"description": "Suggest the use of constant.Kind.String().",
28983007
"type": "boolean",
28993008
"default": false
2900-
},
2901-
"syslog-priority": {
2902-
"description": "Suggest the use of syslog.Priority.",
2903-
"type": "boolean",
2904-
"default": false
29053009
}
29063010
}
29073011
},

pkg/config/linters_settings.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,11 +909,11 @@ type UseStdlibVarsSettings struct {
909909
TimeLayout bool `mapstructure:"time-layout"`
910910
CryptoHash bool `mapstructure:"crypto-hash"`
911911
DefaultRPCPath bool `mapstructure:"default-rpc-path"`
912-
OSDevNull bool `mapstructure:"os-dev-null"`
912+
OSDevNull bool `mapstructure:"os-dev-null"` // Deprecated
913913
SQLIsolationLevel bool `mapstructure:"sql-isolation-level"`
914914
TLSSignatureScheme bool `mapstructure:"tls-signature-scheme"`
915915
ConstantKind bool `mapstructure:"constant-kind"`
916-
SyslogPriority bool `mapstructure:"syslog-priority"`
916+
SyslogPriority bool `mapstructure:"syslog-priority"` // Deprecated
917917
}
918918

919919
type UnconvertSettings struct {

0 commit comments

Comments
 (0)