mirror of
https://github.com/tailscale/tailscale.git
synced 2026-09-14 14:59:57 -04:00
Go 1.27 requires this new v0.8.0-rc.1. But staticcheck 0.8's SA4023 gets stricter and points out that modifiedExternallyError and handleListenersAccept always return non-nil errors, and that MonitorHealth's callers don't need a separate nil check before errors.Is. Simplify all three call sites; no behavior change. But then a handful of other places that SA4023 is angry about are wrong (because it's not considering build tags) and can't be addressed by ignore directives (again not considering build tags), so we just disable SA4023 for now. Updates #20220 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com> Change-Id: I2fefe3b986b5798c2e01624a0e9820839d21a569
27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
# Full list: https://staticcheck.io/docs/checks
|
|
checks = [
|
|
"SA*", "-SA1019", "-SA2001", "-SA9003", # SA* are mostly legit code errors
|
|
|
|
# SA4023 (comparison always/never true) misfires on cross-platform
|
|
# code: per-GOOS stub functions that always return an error on the
|
|
# GOOS being analyzed make correct nil checks look constant. And
|
|
# lint:ignore directives can't help, as they'd be flagged as
|
|
# unmatched on the other GOOSes. Disabled 2026-07-31 with the bump
|
|
# to staticcheck v0.8.0-rc.1, which made the check smarter.
|
|
"-SA4023",
|
|
|
|
# S1?? are "code simplifications" which we consider unnecessary
|
|
|
|
# ST1??? are stylistic issues, some of which are generally accepted
|
|
# In general, if it's listed in
|
|
# https://github.com/golang/go/wiki/CodeReviewComments, then it
|
|
# may be an acceptable check.
|
|
|
|
# TODO(crawshaw): enable when we have docs? "ST1000", # missing package docs
|
|
"ST1001", # discourage dot imports
|
|
|
|
"QF1004", # Use `strings.ReplaceAll` instead of `strings.Replace` with `n == 1`
|
|
"QF1006", # Lift if+break into loop condition
|
|
"U1000", # catch unused code
|
|
]
|