diff --git a/.golangci.toml b/.golangci.toml index f863bbe..f35c3de 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -112,18 +112,6 @@ disable = [ # This would probably be good, but we would need to configure it. "wsl", - # These are all deprecated - "deadcode", - "exhaustivestruct", - "golint", - "ifshort", - "interfacer", - "maligned", - "nosnakecase", - "scopelint", - "structcheck", - "varcheck", - # Require Go 1.22 "copyloopvar", "intrange", @@ -167,11 +155,6 @@ exclude-functions = [ 'os.RemoveAll', ] -# Ignoring Close so that we don't have to have a bunch of -# `defer func() { _ = r.Close() }()` constructs when we -# don't actually care about the error. -ignore = "Close,fmt:.*" - [linters-settings.errorlint] errorf = true asserts = true @@ -619,6 +602,16 @@ linters = [ ] path = "_test.go" +[[issues.exclude-rules]] +linters = [ + "errcheck", +] +# There are many cases where we want to just close resources and ignore the +# error (e.g., for defer f.Close on a read). errcheck removed its built-in +# wildcard ignore. I tried listing all of the cases, but it was too many +# and some were very specific. +source = "\\.Close" + [[issues.exclude-rules]] linters = [ "stylecheck",