The linters package namespace contains custom static analysis linters used by gh-aw quality checks.
Overview
This package currently provides custom Go analyzers in the following subpackages:
excessivefuncparams — reports function declarations that exceed a configurable parameter-count threshold.
largefunc — reports function bodies that exceed a configurable line-count threshold.
osexitinlibrary — reports os.Exit calls in library packages (pkg/*) where process termination should be delegated to cmd/* entry points.
Public API
Subpackages
Subpackage
Description
excessivefuncparams
Custom go/analysis analyzer that flags function declarations with too many positional parameters
largefunc
Custom go/analysis analyzer that flags large functions with actionable diagnostics
osexitinlibrary
Custom go/analysis analyzer that flags os.Exit usage in library packages
Usage Examples
import (
"github.com/github/gh-aw/pkg/linters/excessivefuncparams"
"github.com/github/gh-aw/pkg/linters/largefunc"
"github.com/github/gh-aw/pkg/linters/osexitinlibrary"
)
// Use with multichecker, singlechecker, or custom go/analysis driver.
_ = excessivefuncparams.Analyzer
_ = largefunc.Analyzer
_ = osexitinlibrary.Analyzer
Dependencies
Internal:
None at the pkg/linters namespace level. pkg/linters/{excessivefuncparams,largefunc,osexitinlibrary} are documented above as subpackage APIs, not internal dependencies.
Package linters is a namespace for gh-aw's custom Go analysis linters.
The actual analyzers are implemented in subpackages — see the
excessivefuncparams, largefunc, and osexitinlibrary subdirectories
for analyzer entry points. This file exists so that the directory
can host package-level documentation and an external test package
that asserts the namespace's specification contract.
Package ctxbackground implements a Go analysis linter that flags calls to context.Background() inside functions that already receive a context.Context parameter.
Package ctxbackground implements a Go analysis linter that flags calls to context.Background() inside functions that already receive a context.Context parameter.