Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golangci-lint config #33

Merged
merged 1 commit into from
Jun 3, 2024
Merged
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
27 changes: 10 additions & 17 deletions .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
Loading