Files
tailscale/staticcheck.conf
T
M. J. Fromberger e592a0c363 staticcheck.conf: enable ST1000 to check package docs (#20787)
Fix the small number of existing violations of this check, and enable it for
future runs. The fixes needed were:

 - Clean up a few misspelled package names (probably renames).
 - Clean up a few lexical nits ("Package x" instead of "The x package").
 - Add lint directives to some files affected by build tag variance.
 - Add a missing package comment and re-generate the k8s docs.

The lint overrides are a little ugly, but there are only a few places where we
need them, and it's probably worthwhile to enable the check on the rest of the
repo. Rather than replicate the docs around the build tag, I made the lint
diagnotics reference the "correct" file.

Updates #cleanup

Change-Id: I0d97f2f468542af456a0396cf9a023f04f23e436
Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
2026-08-08 13:02:06 -07:00

27 lines
1.0 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.
"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
]