Merge pull request #16705 from fuweid/add-nakedret

*: migrate nakedret_pass into golangci-lint
This commit is contained in:
Marek Siarkowicz 2023-10-07 19:58:56 +02:00 committed by GitHub
commit c4bbb1b28c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 8 deletions

View File

@ -438,10 +438,6 @@ function unconvert_pass {
run_for_modules generic_checker run_go_tool "github.com/mdempsky/unconvert" unconvert -v
}
function nakedret_pass {
run_for_modules generic_checker run_go_tool "github.com/alexkohler/nakedret/cmd/nakedret"
}
function license_header_per_module {
# bash 3.x compatible replacement of: mapfile -t gofiles < <(go_srcs_in_module)
local gofiles=()

View File

@ -19,6 +19,7 @@ linters:
# - varcheck
- goimports
- ineffassign
- nakedret
- revive
- staticcheck
- stylecheck
@ -27,6 +28,9 @@ linters:
linters-settings: # please keep this alphabetized
goimports:
local-prefixes: go.etcd.io # Put imports beginning with prefix after 3rd-party packages.
nakedret:
# Align with https://github.com/alexkohler/nakedret/blob/v1.0.2/cmd/nakedret/main.go#L10
max-func-lines: 5
revive:
ignore-generated-header: false
severity: error

View File

@ -4,7 +4,6 @@ go 1.21
require (
github.com/alexfalkowski/gocovmerge v1.2.1
github.com/alexkohler/nakedret v1.0.2
github.com/chzchzchz/goword v0.0.0-20170907005317-a9744cb52b03
github.com/cloudflare/cfssl v1.6.4
github.com/coreos/license-bill-of-materials v0.0.0-20190913234955-13baff47494e

View File

@ -14,8 +14,6 @@ github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk
github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/alexfalkowski/gocovmerge v1.2.1 h1:A5j5eGZL1vwGmtMFu2pu9p2skraWTHTQTuf31Pc+Bvc=
github.com/alexfalkowski/gocovmerge v1.2.1/go.mod h1:fKKMhPUyPBf/SF8xvMVkgpblgOT1zSXBK5+03gwgqJM=
github.com/alexkohler/nakedret v1.0.2 h1:Svug5bxPnxbjw1jYlbHlnYAEORehXzsotyMUn2NQO2E=
github.com/alexkohler/nakedret v1.0.2/go.mod h1:pRpUzThUf0nEk2mzur20zmf+6AVzw+3pDWQA0ehUZhI=
github.com/bitfield/gotestdox v0.2.1 h1:Zj8IMLAO5/oiAKoMmtN96eyFiPZraJRTH2p0zDgtxc0=
github.com/bitfield/gotestdox v0.2.1/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY=
github.com/bmatcuk/doublestar/v4 v4.0.2/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=

View File

@ -22,7 +22,6 @@ package tools
import (
_ "github.com/alexfalkowski/gocovmerge"
_ "github.com/alexkohler/nakedret"
_ "github.com/chzchzchz/goword"
_ "github.com/cloudflare/cfssl/cmd/cfssl"
_ "github.com/cloudflare/cfssl/cmd/cfssljson"