Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions pkg/commands/internal/migrate/migrate_linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,10 +789,32 @@ func toSpancheckSettings(old versionone.SpancheckSettings) versiontwo.SpancheckS
}

func toStaticCheckSettings(old versionone.LintersSettings) versiontwo.StaticCheckSettings {
checks := slices.Concat(old.Staticcheck.Checks, old.Stylecheck.Checks, old.Gosimple.Checks)
var checks []string

for _, check := range slices.Concat(old.Staticcheck.Checks, old.Stylecheck.Checks, old.Gosimple.Checks) {
if check == "*" {
checks = append(checks, "all")
continue
}
checks = append(checks, check)
}

checks = Unique(checks)

slices.SortFunc(checks, func(a, b string) int {
if a == "all" {
return -1
}

if b == "all" {
return 1
}

return strings.Compare(a, b)
})

return versiontwo.StaticCheckSettings{
Checks: Unique(checks),
Checks: checks,
Initialisms: old.Stylecheck.Initialisms,
DotImportWhitelist: old.Stylecheck.DotImportWhitelist,
HTTPStatusCodeWhitelist: old.Stylecheck.HTTPStatusCodeWhitelist,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
version: "2"
linters:
settings:
staticcheck:
checks:
- all
- -S1000
- -S1001
- -S1002
- -SA1000
- -SA1001
- -SA1002
- -ST1000
- -ST1001
- -ST1003
- S1003
- S1004
- S1005
- S1006
- S1007
- S1008
- S1009
- S1010
- S1011
- S1012
- S1016
- S1017
- S1018
- S1019
- S1020
- S1021
- S1023
- S1024
- S1025
- S1028
- S1029
- S1030
- S1031
- S1032
- S1033
- S1034
- S1035
- S1036
- S1037
- S1038
- S1039
- S1040
- SA1003
- SA1004
- SA1005
- SA1006
- SA1007
- SA1008
- SA1010
- SA1011
- SA1012
- SA1013
- SA1014
- SA1015
- SA1016
- SA1017
- SA1018
- SA1019
- SA1020
- SA1021
- SA1023
- SA1024
- SA1025
- SA1026
- SA1027
- SA1028
- SA1029
- SA1030
- SA1031
- SA1032
- SA2000
- SA2001
- SA2002
- SA2003
- SA3000
- SA3001
- SA4000
- SA4001
- SA4003
- SA4004
- SA4005
- SA4006
- SA4008
- SA4009
- SA4010
- SA4011
- SA4012
- SA4013
- SA4014
- SA4015
- SA4016
- SA4017
- SA4018
- SA4019
- SA4020
- SA4021
- SA4022
- SA4023
- SA4024
- SA4025
- SA4026
- SA4027
- SA4028
- SA4029
- SA4030
- SA4031
- SA4032
- SA5000
- SA5001
- SA5002
- SA5003
- SA5004
- SA5005
- SA5007
- SA5008
- SA5009
- SA5010
- SA5011
- SA5012
- SA6000
- SA6001
- SA6002
- SA6003
- SA6005
- SA6006
- SA9001
- SA9002
- SA9003
- SA9004
- SA9005
- SA9006
- SA9007
- SA9008
- SA9009
- ST1005
- ST1006
- ST1008
- ST1011
- ST1012
- ST1013
- ST1015
- ST1016
- ST1017
- ST1018
- ST1019
- ST1020
- ST1021
- ST1022
- ST1023
initialisms:
- ACL
- API
- ASCII
- CPU
- CSS
- DNS
- EOF
- GUID
- HTML
- HTTP
- HTTPS
- ID
- IP
- JSON
- QPS
- RAM
- RPC
- SLA
- SMTP
- SQL
- SSH
- TCP
- TLS
- TTL
- UDP
- UI
- GID
- UID
- UUID
- URI
- URL
- UTF8
- VM
- XML
- XMPP
- XSRF
- XSS
- SIP
- RTP
- AMQP
- DB
- TS
dot-import-whitelist:
- fmt
http-status-code-whitelist:
- "200"
- "400"
- "404"
- "500"
Loading
Loading