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>
This commit is contained in:
M. J. Fromberger authored and GitHub committed 2026-08-08 13:02:06 -07:00
1 parent 8bebdca90c
commit e592a0c363
24 files changed
+42 -30

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// ippool implements IP address storage, creation, and retrieval for cmd/natc
// Package ippool implements IP address storage, creation, and retrieval for cmd/natc.
package ippool
import (
+4 -4
View File
@@ -3,8 +3,8 @@
//go:generate go run gen.go
// The buildfeatures package contains boolean constants indicating which
// features were included in the binary (via build tags), for use in dead code
// elimination when using separate build tag protected files is impractical
// or undesirable.
// Package buildfeatures contains boolean constants indicating which features
// were included in the binary (via build tags), for use in dead code
// elimination when using separate build tag protected files is impractical or
// undesirable.
package buildfeatures
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// The condregister package registers all conditional features guarded
// by build tags. It is one central package that callers can empty import
// to ensure all conditional features are registered.
// Package condregister registers all conditional features guarded by build
// tags. It is one central package that callers can empty import to ensure all
// conditional features are registered.
package condregister
import (
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// The doctor package registers the "doctor" problem diagnosis support into the
// Package doctor registers the "doctor" problem diagnosis support into the
// rest of Tailscale.
package doctor
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// The featuretags package is a registry of all the ts_omit-able build tags.
// Package featuretags is a registry of all the ts_omit-able build tags.
package featuretags
import "tailscale.com/util/set"
+1
View File
@@ -6,6 +6,7 @@
## tailscale.com/v1alpha1
Package v1alpha1 documents the k8s-operator API.
### Resource Types
- [Connector](#connector)
+1
View File
@@ -3,6 +3,7 @@
//go:build !plan9
// Package v1alpha1 documents the k8s-operator API.
// +kubebuilder:object:generate=true
// +groupName=tailscale.com
package v1alpha1
+1 -1
View File
@@ -3,7 +3,7 @@
//go:build !plan9
// package ws has functionality to parse 'kubectl exec/attach' sessions streamed using
// Package ws has functionality to parse 'kubectl exec/attach' sessions streamed using
// WebSocket protocol.
package ws
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Package monitor provides facilities for monitoring network
// interface and route changes. It primarily exists to know when
// portable devices move between different networks.
// Package netmon provides facilities for monitoring network interface and
// route changes. It primarily exists to know when portable devices move
// between different networks.
package netmon
import (
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Package STUN generates STUN request packets and parses response packets.
// Package stun generates STUN request packets and parses response packets.
package stun
import (
+2 -2
View File
@@ -3,8 +3,8 @@
//go:build !wasm && !tamago && !aix && !solaris && !illumos
// Package tun creates a tuntap device, working around OS-specific
// quirks if necessary.
// Package tstun creates a tuntap device, working around OS-specific quirks if
// necessary.
package tstun
import (
+2 -2
View File
@@ -3,8 +3,8 @@
// This file is just the types. The bulk of the code is in poller.go.
// The portlist package contains code that checks what ports are open and
// listening on the current machine.
// Package portlist contains code that checks what ports are open and listening
// on the current machine.
package portlist
import (
+1 -1
View File
@@ -17,7 +17,7 @@ checks = [
# 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
"ST1000", # missing package docs
"ST1001", # discourage dot imports
"QF1004", # Use `strings.ReplaceAll` instead of `strings.Replace` with `n == 1`
+3 -3
View File
@@ -1,9 +1,9 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// The deptest package contains a shared implementation of negative
// dependency tests for other packages, making sure we don't start
// depending on certain packages.
// Package deptest contains a shared implementation of negative dependency
// tests for other packages, making sure we don't start depending on certain
// packages.
package deptest
import (
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// tkatest has functions for creating a mock control server that responds
// to TKA endpoints.
// Package tkatest has functions for creating a mock control server that
// responds to TKA endpoints.
package tkatest
import (
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// Package appcfg contains an experimental configuration structure for
// Package appctype contains an experimental configuration structure for
// "tailscale.com/app-connectors" capmap extensions.
package appctype
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// ctxkey provides type-safe key-value pairs for use with [context.Context].
// Package ctxkey provides type-safe key-value pairs for use with [context.Context].
//
// Example usage:
//
+1 -1
View File
@@ -1,7 +1,7 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// The goroutines package contains utilities for tracking and getting active goroutines.
// Package goroutines contains utilities for tracking and getting active goroutines.
package goroutines
import (
+2 -2
View File
@@ -1,8 +1,8 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
// nocasemaps provides efficient functions to set and get entries in Go maps
// keyed by a string, where the string is always lower-case.
// Package nocasemaps provides efficient functions to set and get entries in Go
// maps keyed by a string, where the string is always lower-case.
package nocasemaps
import (
+2
View File
@@ -3,6 +3,8 @@
//go:build !windows
//lint:file-ignore ST1000 see filesharingstatus_windows.go
package osshare
import (
+2
View File
@@ -1,6 +1,8 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//lint:file-ignore ST1000 see authenticode_windows.go
package authenticode
//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go mksyscall.go
+2
View File
@@ -1,6 +1,8 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//lint:file-ignore ST1000 see gp_windows.go
package gp
//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go mksyscall.go
+2
View File
@@ -1,6 +1,8 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//lint:file-ignore ST1000 see s4u_windows.go
package s4u
//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go mksyscall.go
+2
View File
@@ -1,6 +1,8 @@
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause
//lint:file-ignore ST1000 see winenv_windows.go
package winenv
//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go mksyscall.go